У меня есть следующий вспомогательный объект:
LikeHelper* likeHelper = [[LikeHelper alloc]init];
likeHelper.delegate = self;
[likeHelper performLike:self.messageID];
[likeHelper release];likeHelper=nil;
executeLike выполнит некоторые действия NSURLConnection, а затем сообщит делегату, успешно ли это произошло.
#pragma mark LikeHelperDelegate Methods
-(void)performLikeFinished:(BOOL)isSuccessful{
if (isSuccessful) {
UIAlertView *alertView;
alertView = [[UIAlertView alloc] initWithTitle:@"Success!" message:@"The message has been liked" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alertView show];
[alertView release];
}
else {
UIAlertView *alertView;
alertView = [[UIAlertView alloc] initWithTitle:@"Error!" message:@"There was a problem liking your message" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alertView show];
[alertView release];
}
}
Я выпускаю likeHelper в нужном месте?