0

I have a singleton object which has ivar NSMutableArray which holds images global to application. And I have a UITableViewController class which represents image attaches to the message.I want to do next: when user select images from Camera Roll they are added to that singleton's array. And I want to reload tableview of my UITableViewController at once to display these new messages. How can I implement this? Should I use Key-Value Observing for this and if yes how can I do this? (I should notify when new object will be added to array). Or may be there are some other more correct way?

1
  • When you add object to array call [tableview reloadData] Commented Jul 18, 2013 at 13:43

3 Answers 3

1

i know exactly what u need to Do.Download this Demo for reference.

it has delegate method

    - (void)imagePicker:(GKImagePicker *)imagePicker pickedImage:(UIImage *)image{

     // add your code here for adding image to Your mutable array and then Reload your tableView.

      }
Sign up to request clarification or add additional context in comments.

Comments

0

What about sending a NSNotification when you want the view to reload?

The UITableView can receives the notification and reload the data.

Comments

0

add notification in which class has table

 [[NSNotificationCenter defaultCenter] addObserver:self
                                             selector:@selector(actionremovecalender:)
                                                 name:@"subMitReport"
                                               object:nil];
-(void)actionremovecalender:(NSNotification *)notification
{
   //table relaod code
}
call to another class
 [[NSNotificationCenter defaultCenter] postNotificationName:@"subMitReport" object:self];

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.