KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I am trying to update an object in NSMutableArray . Product *message = (Product*)[notification object]; Product *prod = nil; for(int i = 0; i < ProductList.count; i++) { prod = [ProductList objectAtIndex:i]; if([message.ProductNumber isEqualToString:prod.ProductNumber]) { prod.Status = @"NotAvaiable"; prod.Quantity = 0; [ProductList removeObjectAtIndex:i]; [ProductList insertObject:prod atIndex:i]; break; } } Is there any better way to do this?
Tags (comma-separated)
Save Edits
Cancel