Please do not post the same thing multiple times. The board software automatically flags certain posts as needing moderator attention. This happens the most often for new users. I'm pretty sure this is made clear at the time you attempt to post. Posting the same thing over and over again just makes that many more posts the moderators have to weed through later. This makes us sad. Don't make us sad. If your post/thread doesn't appear, just wait a while. Don't post it again. If it hasn't shown up by the next day, then you can try again. I normally go through posts in the mornings, and try to check a few times throughout the day, but I'm not here 24/7. There will typically be a significant delay before posts are approved. Just be patient.
Problem with UI Button (it's not working after a few moments and apps gets slow )
I am newbie in iphone apps i am building a app with 5 UiviewController. In my 2nd view a button is placed which points to 3 rd view. There a barcode scanning process held and goes to the 4th view. There is a back button option to come back to 2nd view from 4th view and the process continues...:D:D:D
But after a few moments the 2nd view button is not responding to touch sometimes and the apps gets slow.
As well as the the buttons in the 4th view also not working. I have pragmatically created some UI component in those 2, 3, 4th view & init them with CGrectmake and release them also. i also release all the variable in dealloc method when switching from one view to another.
But if i restart my app it's works fine like previous but after a few time of repeatation the same thing happens.
Plz help me out what to do to get the UI button Response all time and make the app faster.:confused:
I am newbie in iphone apps i am building a app with 5 UiviewController. In my 2nd view a button is placed which points to 3 rd view. There a barcode scanning process held and goes to the 4th view. There is a back button option to come back to 2nd view from 4th view and the process continues...
But after a few moments the 2nd view button is not responding to touch sometimes and the apps gets slow.
As well as the the buttons in the 4th view also not working. I have pragmatically created some UI component in those 2, 3, 4th view & init them with CGrectmake and release them also. i also release all the variable in dealloc method when switching from one view to another.
But if i restart my app it's works fine like previous but after a few time of repeatation the same thing happens.
Plz help me out what to do to get the UI button Response all time and make the app faster.:confused:
scan_book.layer.cornerRadius = 5; // this value vary as per your desire scan_book.clipsToBounds = YES; scan_book.layer.borderColor = [UIColor blackColor].CGColor; scan_book.layer.borderWidth = .5f;
Replies
in 2nd view controller: (view did load)
CAGradientLayer *bgLayer = [BackgroundLayer blueGradient];
bgLayer.frame = self.view.bounds;
[self.view.layer insertSublayer:bgLayer atIndex:0];
//scan_book is the button that is not working
scan_book.multipleTouchEnabled=YES;
[scan_book setExclusiveTouch:NO];
UINavigationBar *naviBarObj = [[UINavigationBar alloc] initWithFrame:CGRectMake(0, 0, 320, 44)];
UIButton*backButton =[[UIButton alloc] initWithFrame:CGRectMake(14.0, 0.0, 120.0, 36.0)];
[backButton addTarget:self action:@selector(placeonline:) forControlEvents:UIControlEventTouchUpInside];
[backButton setTitle:@"Place online " forState:UIControlStateNormal];
CGFloat navBarHeight = 40.0f;
CGRect frame = CGRectMake(0.0f, 0.0f, 100.0f, navBarHeight);
[backButton setFrame:frame];
UIBarButtonItem* backItem = [[UIBarButtonItem alloc] initWithCustomView:backButton];
UINavigationItem *navigItem = [[UINavigationItem alloc] initWithTitle:@"Scanned Book"];
label = [[UILabel alloc] initWithFrame:CGRectMake(140.0, 0.0, 120.0, 36.0)];
navigItem.titleView = label;
navigItem.rightBarButtonItem = backItem;
[self.view addSubview:naviBarObj];
scan_book.layer.cornerRadius = 5; // this value vary as per your desire
scan_book.clipsToBounds = YES;
scan_book.layer.borderColor = [UIColor blackColor].CGColor;
scan_book.layer.borderWidth = .5f;
when i go from 2nd to 3rd controller:
- (IBAction)scan_book:(id)sender {
EmbedReaderViewController *nextController = [[EmbedReaderViewController alloc] initWithNibName:@"EmbedReaderViewController" bundle:nil];
nextController.backtitile=tabledata;
[self.view addSubview:nextController.view];
[self.view release];
}
in 3rd view controller: view did load
UINavigationBar *naviBarObj = [[UINavigationBar alloc] initWithFrame:CGRectMake(0, 0, 320, 44)];
[naviBarObj setTintColor:[UIColor MyColor]];
UIButton*backButton =[[UIButton alloc] initWithFrame:CGRectMake(14.0, 0.0, 120.0, 36.0)];
CGFloat navBarHeight = 40.0f;
CGRect frame = CGRectMake(0.0f, 0.0f, 120.0f, navBarHeight);
[backButton setFrame:frame];
UIBarButtonItem* backItem = [[UIBarButtonItem alloc] initWithCustomView:backButton];
UINavigationItem *navigItem = [[UINavigationItem alloc] initWithTitle:@"Scanned Book"];
UILabel * label = [[UILabel alloc] initWithFrame:CGRectMake(120.0, 0.0, 200.0, 36.0)];
label.text= @"Scan book";
navigItem.titleView = label;
navigItem.leftBarButtonItem = backItem;
naviBarObj.items = [NSArray arrayWithObjects: navigItem,nil];
[naviBarObj setTranslucent:YES];
[self.view addSubview:naviBarObj];
3rd view to 4 th view:
setprice_screen *nextController = [[setprice_screen alloc] initWithNibName:@"setprice_screen" bundle:nil];
nextController.barcode_no=soapResults;
nextController.backData=backtitile;
nextController.camera_barcode=[barcode_bar objectAtIndex:0];
// nextController.camera_barcode=[NSMutableString stringWithString:camera_barcode];
[self.view addSubview:nextController.view];
[self.view release];
4th view viewdidload:
UINavigationBar *naviBarObj = [[UINavigationBar alloc] initWithFrame:CGRectMake(0, 0, 320, 44)];
UIButton*backButton =[[UIButton alloc] initWithFrame:CGRectMake(140.0, 0.0, 120.0, 36.0)];
UIBarButtonItem* backItem = [[UIBarButtonItem alloc] initWithCustomView:backButton];
UINavigationItem *navigItem = [[UINavigationItem alloc] initWithTitle:@"Books"];
label = [[UILabel alloc] initWithFrame:CGRectMake(140.0, 0.0, 220.0, 36.0)];
navigItem.titleView = label;
navigItem.leftBarButtonItem = backItem;
naviBarObj.items = [NSArray arrayWithObjects: navigItem,nil];
[self.view addSubview:naviBarObj];
4th view to 2nd view :
- (void) backAction{
booklist_screen *nextController = [[booklist_screen alloc] initWithNibName:@"booklist screen" bundle:nil];
[self.view addSubview:nextController.view];
[self.view release];
}
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
in the 4 th view i have to uiview and 2 more button
if one press one button then one view visible and another uiview set hidden. alternate button also do the same.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like Awesome