Reputation: 43
I have very strange problem with my app. I'm using AFNetworking framework in my app. I'm loading some feed with images and onclick action open new view with detail description and big image. So I send IdPhoto to the description view, but when IdPhoto is more then 12 prepareForSegue send address in memory instead of IdPhoto value.
-(void)didSelectPhoto:(PhotoView*)sender {
//photo selected - show it full screen
[self performSegueWithIdentifier:@"ShowPhoto" sender:[NSNumber numberWithInt:sender.tag]];
}
-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
if ([@"ShowPhoto" compare: segue.identifier]==NSOrderedSame) {
DescrController* streamPhotoScreen = segue.destinationViewController;
streamPhotoScreen.IdPhoto = sender;
}
}
part of PhotoView code
-(id)initWithIndex:(int)i andData:(NSDictionary*)data {
self = [super init];
if (self !=nil) {
//initialize
self.tag = [[data objectForKey:@"IdPhoto"] intValue];
so I couldn't understand why it doesn't send IdPhoto to another View when the value more then 12
Upvotes: 1
Views: 68
Reputation: 1131
Upvotes: 1
Reputation: 2185
I think you need to upcast/downcast(sender)
to be appropriate for streamPhotoScreen.IdPhoto
.
Upvotes: 0