KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I saw many threads related to this issue, but none addresses my case (I think). My case should be simple, I have a Custom UIView in my controller, from my controller, I use the [ self.myView setNeedsDisplay ] and it works perfectly. I'm having problems when Im trying to call this from inside of the UIView itself...I have a notification being sent from another class, and it is being received by my View (this works) with the information it passes, I update internal properties of this view and than I'm calling the [self setNeedsDisplay ] wishing to have my screen updated with the new states, but nothing is happening, I used a NSLOG inside my drawRec method, and it is not being called at this time, it is only called when my controller class call the setNeedsDisplay , and when that happens, the update that should have happened before is showed on screen... I don't know why its not updating before... Here are some code: My controller asking for update: (works OK!) - (void)addNodeToNetwork:(DTINode *)node { [self.myNetwork addNodeInTheNetwork:node]; self.gridView.nodesToDraw = [self.myNetwork.nodesInNetwork copy]; CGRect tempRec = CGRectMake(node.nodePosition.x, node.nodePosition.y node.nodePosition.x, node.nodePosition.y); NSValue *rectObj = [NSValue valueWithCGRect:tempRec]; //transforma o cgrect num objeto [self.gridView.fatherNodes setValue:rectObj forKey:node.nodeName]; [self.gridView setNeedsDisplay]; } My notification method trying to update my drawing: (Not Working ! ) - (void) receiveTestNotification:(NSNotification *) notification { NSDictionary *userInfo = notification.userInfo; DTINode *notificationNode = [userInfo objectForKey:@"myNode"]; NSLog(@"Im Here!"); for (DTINode *node in self.nodesToDraw) { NSLog(@"Here too"); if(node.nodeName == notificationNode.fatherNode) {
Tags (comma-separated)
Save Edits
Cancel