objective c - How can I access the property in an object that has an unknown class? -


my initial code was

[[[show episodes] lastobject] setdescription:nodecontent]; 

this gets last object episodes array , tries set episode's description property using nodecontent. not work because think compiler not know class of episode object.

i tried providing cast

((episoderepresentation *)[[show episodes] lastobject]).description = nodecontent; 

this doesn't work either. have tried unsuccessfully

episoderepresentation *rep = [[show episodes] lastobject]; rep.description = nodecontent; 

all these ways leave description null (nodecontent not null, nsstring).

your array empty. try [[show episodes] count] number of objects in array.

btw: naming of classes , methods seems odd. classes begin captal letters , methods lower case letters.


Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -