objective c - Why does calling a property on NSObject pointer gives build errors? -


i have nsmutablearray returns me object. object added had properties name,age.

now when use these properties on object returned (obj.name or obj.age ), compiler says, no such member, use (->) instead of (.)

i understand nsobject wont have these members , hence wont understand property.

but if use setters, , getters method ([obj name] or [obj age]) syntax instead of properties, dont errors.

but using property means calling setter or getter ?
ad objective c suppose dynamic language, right ?

that's right - dot syntax not supported in such case.

you need cast pointer actual class:

((myobject*)[array objectatindex: 0]).name = @"bill"; 

Comments

Popular posts from this blog

delphi - How to convert bitmaps to video? -

jasper reports - Fixed header in Excel using JasperReports -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -