ios - Crash with "message sent to deallocated instance" when touching UITextField -
i have implementation of uiviewcontroller
following code viewdidload
:
- (void)viewdidload { [super viewdidload]; // additional setup after loading view nib. (int i=0; i<10; i++) { nsuserdefaults *prefs = [nsuserdefaults standarduserdefaults]; nsstring *speeddial = [prefs stringforkey:[nsstring stringwithformat:@"%s%i", "fav",i]]; if ([speeddial length] > 0) [self gettextfield:i].text = speeddial; [self gettextfield:i].returnkeytype = uireturnkeydone; [self gettextfield:i].delegate = self; } }
when touch uitextfield
on screen app crashes , output: "message sent deallocated instance". have same error when pressing button on view guess error @ uiviewcontroller
level. using arc
, uitextfield
defined strong
. have tried looking memory management issues no success.
any idea?
thanks, simon
in [self.view addsubview:favorites.view];
using favorites view allowing controller fall out of scope. object creates favorites
should keep around strong reference instead of making local variable.
Comments
Post a Comment