Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

darthtong

macrumors newbie
Original poster
Jul 9, 2008
4
0
Hi all,

I have an NSInteger property of a custom class called 'estimatedTime', now, in my UITableView class I'm trying to pass this property as a pointer to a UITableViewCell. I can't seem to get it to work! I've tried the following:

NSInteger *pointer = sharedManager.tempTask.&estimatedTime;
NSInteger *pointer = &sharedManager.tempTask.estimatedTime;

I get the errors: lvalue required as unary '&' operand
and: expected identifier before '&' token

Can you not pass a pointer to a property? Is the property not just it self pointing to the ivar in my custom class? I need it as a pointer type so I can edit the value when a UITextField is changed inside the UITableViewCell.

Thanks and hope it makes sense!
 
In my experience, it's much easier to just pass in your tempTask to the UITableViewCell, and when the user makes changes in the UITextField, simply update the property on that object. Passing pointers to NSInteger types is going to cause more headache than it's worth!
 
Wow...didn't think of that!

Thank you so much, something so simple!

In my experience, it's much easier to just pass in your tempTask to the UITableViewCell, and when the user makes changes in the UITextField, simply update the property on that object. Passing pointers to NSInteger types is going to cause more headache than it's worth!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.