Search Results

Search found 2691 results on 108 pages for 'ios 4'.

Page 56/108 | < Previous Page | 52 53 54 55 56 57 58 59 60 61 62 63  | Next Page >

  • Restore and preserve UIViewController pushed from UINavigationController, no storyboard

    - by user2908112
    I try to restore a simple UIViewController that I pushed from my initial view controller. The first one is preserved, but the second one just disappear when relaunched. I don't use storyboard. I implement the protocol in every view controller and add the restorationIdentifier and restorationClass to each one of them. The second viewController inherit from a third viewController and is initialized from a xib file. I'm not sure if I need to implement the UIViewControllerRestoration to this third since I don't use it directly. My code looks like typically like this: - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; if (self) { // Custom initialization self.restorationIdentifier = @"EditNotificationViewController"; self.restorationClass = [self class]; } return self; } -(void)encodeRestorableStateWithCoder:(NSCoder *)coder { } -(void)decodeRestorableStateWithCoder:(NSCoder *)coder { } +(UIViewController *)viewControllerWithRestorationIdentifierPath:(NSArray *)identifierComponents coder:(NSCoder *)coder { EditNotificationViewController* envc = [[EditNotificationViewController alloc] initWithNibName:@"SearchFormViewController" bundle:nil]; return envc; } Should perhaps the navigationController be subclassed so it too can inherit from UIViewControllerRestoration?

    Read the article

  • Sharing same properties of ViewController for iPhone Stroryboard and iPad Story Board

    - by Ruhul Amin
    I'm developing a universal application. in the first view, I have the login screen for the user. In iPhone storyBoard, I have added 2 text field and one button( login check). I have added properties in ViewController.h file by dragging those objects(Ctrl key + Dragg) to .h file. I have added code for login check and it is working fine for iPhone. This is the code in ViewController.h @property (strong, nonatomic) IBOutlet UITextField *txtUserId; @property (strong, nonatomic) IBOutlet UITextField *txtUserPwd; @property (strong, nonatomic) IBOutlet UIButton *btnLogin; In the iPad storyBoard, I have added 2 text field( userid and password) and i button for login. So now, I want to bind those objects with the veriable which I declared already in ViewController.h file in case of iPhone. My questions: 1. What is the right way to bind properties for both storyboard? 2. Am I on the right direction or should I think in a different way to do it? I am new with iPhone development. Please help. Thanks. --Amin

    Read the article

  • How to have Xcode find the newest version of a file

    - by Arian
    Currently I have a SQLite database, that is set statically to use database01.sqlite... but what I need is a way to have the file path find the newest version of the database file that exists. For example: If a database file of database04.sqlite is available, it should use that one instead. Below is my current code: NSString *databaseDirectory = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0]; NSString *filePath = [databaseDirectory stringByAppendingPathComponent:@"database01.sqlite"];

    Read the article

  • popViewControllerAnimated doesn't update info iPhone SDK

    - by WrightsCS
    When I try to pop a view controller, it doesnt update info for the previous view. Example: I have a cell that displays text in a label in View1. When you click on the cell it goes to View2 (for example) When I choose an option in View2, popViewControllerAnimated is used to go back to View1, however, I want the label to now be updated with the new option in View1. My dilemma is that when I pop View2, the label in View1 does not update. Any ideas? I've tried adding a [view1 reloadData]; before the view pops, but no luck. //VIEW1 the cell that displays the label. ringLabel = [[UILabel alloc] initWithFrame: CGRectMake(25, 12.7f, 250, 20)]; ringLabel.adjustsFontSizeToFitWidth = YES; ringLabel.textColor = [UIColor blackColor]; ringLabel.font = [UIFont systemFontOfSize:17.0]; ringLabel.backgroundColor = [UIColor clearColor]; ringLabel.textAlignment = UITextAlignmentLeft; ringLabel.tag = 0; ringLabel.text = [plistDict objectForKey:@"MYOPTION"]; [ringLabel setEnabled:YES]; [cell addSubview: ringLabel]; [ringLabel release]; //VIEW2 when cell clicked CustomProfileViewController *cpvc = [CustomProfileViewController alloc]; cpvc.ringtone = [ringList objectAtIndex:indexPath.row]; [cpvc.tblCustomTable reloadData]; [self.navigationController popViewControllerAnimated:YES];

    Read the article

  • How to get a green to show up like the charging battery on the iPhone lock screen?

    - by tarheel
    I am trying to get a color to show up on screen just like the charging battery (shown here): After looking at the Apple Documentation on UIColor here, I have attempted using both colorWithHue:saturation:brightness:aplha: and colorWithRed:green:blue:alpha: to get a color to show up like that. For example when I use colorWithHue:.3 saturation:.84 brightness:1 alpha:.5 on a black background, it renders a color like this: or the colorWithRed:0 green:1 blue:0 alpha:.5 on a black background shows up like this: It doesn't have that translucent or glossy look to it. Is there a better method to use? Or do I just not have the values right? (I have tried many combinations)

    Read the article

  • not saving when using setDidReceiveDataSelector

    - by coder4xc
    i want to download a file and show the progress bar i was able to do this. now , i want to show the progress value in a label and use this code to progress init and update label : [queue setDelegate:self]; [queue setRequestDidFinishSelector:@selector(updateLabel)]; [queue setDownloadProgressDelegate:progress]; [queue setShowAccurateProgress:YES]; ASIHTTPRequest *request; request = [ASIHTTPRequest requestWithURL:url]; [request setDelegate:self]; [request setTemporaryFileDownloadPath:[filePath stringByAppendingString:@".download"]]; [request setAllowResumeForFileDownloads:YES]; [request setDidFinishSelector:@selector(updateLabel)]; [request setDidReceiveDataSelector:@selector(updateLabel)]; [request setShouldContinueWhenAppEntersBackground:YES]; [request setShouldAttemptPersistentConnection:NO]; [request setDownloadDestinationPath:filePath]; [queue addOperation:request]; [queue go]; but not save in the destination path ! and when i clear this code :  [request setDidReceiveDataSelector:@selector(updateLabel)]; saving done ! what is problem ? i want to update label text when progress value changed

    Read the article

  • Store NSArray In Core Data Sample Code?

    - by Stunner
    Ey guys, I have been searching for some sample code on how to store an NSArray in Core Data for awhile now, but haven't had any luck. Would anyone mind pointing me to some tutorial or example, or better yet write a simple sample as an answer to this question? I have read this but it doesn't show an example of how to go about implementing a transformable attribute that is an NSArray. Thanks in advance!

    Read the article

  • numeric sort with NSSortDescriptor for NSFetchedResultsController

    - by edziubudzik
    I'm trying to numerically sort data that's displayed in a UITableView. Before that I used such a sort descriptor: sortDescriptor = [[NSSortDescriptor alloc] initWithKey:@"name" ascending:YES selector:@selector(caseInsensitiveCompare:)]; now I'd like to use block to sort this numerically like this: sortDescriptor = [[NSSortDescriptor alloc] initWithKey:@"name" ascending:YES comparator:^NSComparisonResult(id obj1, id obj2) { return [((NSString *)obj1) compare:(NSString *)obj2 options:NSCaseInsensitiveSearch | NSNumericSearch]; }]; but it sorts the data incorectly causing conflict with section names in NSFetchedResultsController. So I tryed to immitate the old sorting with a comparator block - just to be sure that the problem is not caused by numeric comparison. The problem is that those lines: sortDescriptor = [[NSSortDescriptor alloc] initWithKey:@"name" ascending:YES comparator:^NSComparisonResult(id obj1, id obj2) { return [((NSString *)obj1) caseInsensitiveCompare:(NSString *)obj2]; }]; also cause the same error and I don't see why they won't sort the data in the same way the first method did... Any ideas?

    Read the article

  • When I select any segment in segmentControll it doesnot show highlighted

    - by rathodrc
    NSArray *itemArray = [NSArray arrayWithObjects:@"one", @"Two", @"Three", nil]; segmentControl = [[UISegmentedControl alloc] initWithItems:itemArray]; segmentControl.frame = CGRectMake(5, 5, 325, 35); segmentControl.segmentedControlStyle = UISegmentedControlStyleBar; segmentControl.tintColor = [UIColor blackColor]; [self changeUISegmentFont:segmentControl]; //[self.view addSubview:segmentControl]; self.navigationItem.titleView = segmentControl; [segmentControl addTarget:self action:@selector(segmentAction:) forControlEvents:UIControlEventValueChanged]; This is my code of segment control and my problem is .. When I select any segment it does not show me that that segment is selected.. I mean it is not shown highlighted.. can Anyone tell me what the problem is??

    Read the article

  • Using NSArray for C-type int comparisons

    - by Andrew Barinov
    I would like to iterate through an NSArray of ints and compare each one to a specific int. All ints are C type ints. The code I am using is as follows: -(int)ladderCalc: (NSArray*)amounts: (int)amount { int result; for (NSUInteger i=0; i< [amounts count]; i++) { if (amount < [amounts objectAtIndex:i]); { // do something } // do something } } However I get an error when comparing the int amount to the result of [amounts objectAtIndex:i] because you cannot compare id to int. Why is the id involved in this case? Shouldn't objectAtIndex just return the object at the index specified? Is it possible to cast the object returned to an C int and then do the comparison? Or should I just dispense with NSArray and do this type of thing in C?

    Read the article

  • cellForRowAtIndexPath not called for all sections

    - by Wynn
    I have a UITableView that has five sections. Just as the title describes cellForRowAtIndexPath is only being called for the first four. All connections have been made concerning the datasource and delegate. Also, my numberOfSectionsInTableView clearly returns 5. Printing out the number of sections from within cellForRowAtIndexPath shows the correct number, thus confirming that cellForRowAtIndexPath is simply not being called for all sections. What on earth is going on? I looked pretty hard for an answer to this question but could't find one. If this has already been answered please forgive me and point me in the correct direction. My cellForRowAtIndexPath: - (UITableViewCell *)tableView:(UITableView *)theTableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [theTableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier]; } switch (indexPath.section) { case 0: cell.textLabel.text = ticket.description; break; case 1: cell.textLabel.text = ticket.ticketStatus; break; case 2: cell.textLabel.text = ticket.priority; break; case 3: cell.textLabel.text = ticket.customerOfficePhone; break; case 4: { //This never ever gets executed Comment *comment = [ticket.comments objectAtIndex:indexPath.row]; cell.textLabel.text = comment.commentContent; break; } } return cell; } My numberOfSectionsInTableView: - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { return 5; } My numberOfRowsInSection: - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { NSInteger numberOfRows; if (section == 4) { numberOfRows = [ticket.comments count]; } else { numberOfRows = 1; } return numberOfRows; } Any suggestions are appreciated. Thanks in advance.

    Read the article

  • Errors in UILabel

    - by Todd Davies
    I'm trying to use the FXlabel when following this (Adding a gradient label section) tutorial. This is some of the code inside my viewDidLoad method: self.logoLabel = [[FXLabel alloc] initWithFrame:CGRectMake(14, 11, 280, 87)]; [logoLabel setFont:[UIFont boldSystemFontOfSize:45]]; [logoLabel setTextColor:[UIColor whiteColor]]; [logoLabel setShadowColor:[UIColor blackColor]]; [logoLabel setShadowOffset:CGSizeMake(0, 2)]; [logoLabel setTextAlignment:UITextAlignmentCenter]; [logoLabel setBackgroundColor:[UIColor clearColor]]; [logoLabel setText:@"Attorney Biz"]; [logoLabel setGradientStartColor:[UIColor colorWithRed:163.0/255 green:203.0/255 blue:222.0/255 alpha:1.0]]; [logoLabel setGradientEndColor:[UIColor whiteColor]]; Unfortnuately, I get an error "No visible @interface for 'UILabel' declares the selector 'setGradientStartColor'" at the second-to-last line and "No visible @interface for 'UILabel' declares the selector 'setGradientEndColor'" Can somebody explain how to remove these errors?

    Read the article

  • fetchBatchSize to be same as fetchLimit

    - by user1730622
    What does it mean to have fetchBatchSize to be the same as fetchLimit, say both are set to be 5. My understanding is that, with the fetchLimit, then only 5 records will be in the fetch result set; and additionally with the fetchBatchSize, only the ids/identities of the records will be read to the memory, and then the full records won't be retrieved until they are accessed. Is that a correct understanding?

    Read the article

  • UIView to Form Sheet flip animation rotation issue

    - by GSD
    I have this view to form sheet flip animation that works great in portrait mode but not in any other orientations. In my code, I use it with a UIView embedded in another UIView, which is in the root view. The animation will be rotated. Anyone has an idea why? - (void)presentModalViewControllerWithFlipAnimation:(UIViewController *)modalViewController fromView:(UIView *)fromView { UIWindow* window = [[UIApplication sharedApplication] windows][0]; _fromViewSnapshot = [[UIImageView alloc] initWithFrame:fromView.bounds]; UIGraphicsBeginImageContext(fromView.bounds.size); [fromView.layer renderInContext:UIGraphicsGetCurrentContext()]; [_fromViewSnapshot setImage:UIGraphicsGetImageFromCurrentImageContext()]; [_fromViewSnapshot sizeToFit]; UIGraphicsEndImageContext(); _fromViewSnapshot.autoresizesSubviews = YES; _fromViewSnapshot.frame = [fromView.superview convertRect:fromView.frame toView:window]; [window addSubview:_fromViewSnapshot]; fromView.hidden = YES; modalViewController.modalPresentationStyle = UIModalPresentationFormSheet; [self presentViewController:modalViewController animated:NO completion:nil]; UIView __weak *presentedView = modalViewController.view.superview; UIGraphicsBeginImageContext(presentedView.bounds.size); [presentedView.layer renderInContext:UIGraphicsGetCurrentContext()]; UIImage* modalSnapshot = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); UIView __weak *presentationSuperview = presentedView.superview; [presentedView removeFromSuperview]; UIImageView* presentationSnapshotView = [[UIImageView alloc] initWithImage:modalSnapshot]; presentationSnapshotView.autoresizingMask = UIViewAutoresizingNone; [_fromViewSnapshot.superview bringSubviewToFront:_fromViewSnapshot]; [UIView animateWithDuration:kFlipAnimationScaleSpeed delay:0 options:UIViewAnimationOptionCurveEaseIn|UIViewAnimationOptionBeginFromCurrentState animations: ^{ [UIView animateWithDuration:kFlipAnimationScaleSpeed delay:0 options:UIViewAnimationOptionBeginFromCurrentState animations: ^{ _fromViewSnapshot.frame = [_fromViewSnapshot.superview convertRect:presentedView.frame fromView:presentationSuperview]; } completion:nil]; } completion:^(BOOL finished) { [UIView setAnimationBeginsFromCurrentState:YES]; [UIView transitionWithView:_fromViewSnapshot duration:kFlipAnimationSpeed options:UIViewAnimationOptionCurveEaseIn|UIViewAnimationOptionTransitionFlipFromRight animations: ^{ presentationSnapshotView.frame = _fromViewSnapshot.bounds; [_fromViewSnapshot addSubview:presentationSnapshotView]; } completion:^(BOOL finished) { [presentationSuperview addSubview:presentedView]; [presentationSnapshotView removeFromSuperview]; [_fromViewSnapshot removeFromSuperview]; }]; }]; } - (void)dismissViewControllerWithFlipAnimation:(UIView*)fromView completion:(void (^)(void))completion { UIWindow* window = [[UIApplication sharedApplication] windows][0]; UIView __weak *presentedView = self.presentedViewController.view.superview; UIGraphicsBeginImageContext(presentedView.bounds.size); [presentedView.layer renderInContext:UIGraphicsGetCurrentContext()]; UIImage* modalSnapshot = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); [presentedView removeFromSuperview]; UIImageView* presentationSnapshotView = [[UIImageView alloc] initWithImage:modalSnapshot]; presentationSnapshotView.autoresizingMask = UIViewAutoresizingNone; presentationSnapshotView.frame = presentedView.frame; [window addSubview:presentationSnapshotView]; [UIView animateWithDuration:kFlipAnimationScaleSpeed delay:0 options:UIViewAnimationOptionCurveEaseIn|UIViewAnimationOptionBeginFromCurrentState animations: ^{ [UIView animateWithDuration:kFlipAnimationScaleSpeed delay:0 options:UIViewAnimationOptionBeginFromCurrentState animations: ^{ presentationSnapshotView.frame = [fromView.superview convertRect:fromView.frame toView:window]; } completion:nil]; } completion:^(BOOL finished) { [UIView setAnimationBeginsFromCurrentState:YES]; [UIView transitionWithView:presentationSnapshotView duration:kFlipAnimationSpeed options:UIViewAnimationOptionCurveEaseIn|UIViewAnimationOptionTransitionFlipFromLeft animations: ^{ _fromViewSnapshot.frame = presentationSnapshotView.bounds; [presentationSnapshotView setImage:[(UIImageView*)_fromViewSnapshot image]]; [self dismissViewControllerAnimated:NO completion:nil]; } completion:^(BOOL finished) { [presentationSnapshotView removeFromSuperview]; _fromViewSnapshot = nil; completion(); }]; }]; }

    Read the article

  • Get nul value from one ViewController to one ViewController

    - by sovannarith
    I have 2 ViewControllers namely V1 and V2. I want to pass value from V2 to V1 but I get value 0 for countV1 in V1. I saw more questions in stackoverflow but I can't deal with this small problem. I use ARC. In V1 .h file @property(nonatomic,unsafe_unretained) int countV1; .m file @synthesize countV1; In V2 .m file int countV2 = 1; V1 *v1 = [V1 alloc] initWithNibName:@"V1" bundle:nil]; v1.countV1 = countV2;

    Read the article

  • Split screen in iPad

    - by AAT
    I working on a iPAD only app which requires me to split the screen such a way that: (1) there are 2 parts on the screen divided vertically (2) On the left side, user can communicate using a chat (3) On the right side, user can see continuous streaming data I am not sure (A) how can I do two tasks simultaneously (B)how to split the screen (is Split view the way to achieve both of these?) Thank you.

    Read the article

  • Correcting a plist with dictionaries

    - by ingenspor
    Plist is copyed to documents directory if it doesn't exist. If it already exists, I want to use the "Name" key from NSDictionary in bundleArray to find the matching NSDictionary in documentsArray. When the match is found, I want to check for changes in the strings and replace them if there is a change. If a match is not found it means this dictionary must be added to documents plist. This is my code: - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { [self managePlist]; return YES; } - (void)managePlist { NSError *error; NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; NSString *path = [documentsDirectory stringByAppendingPathComponent:@"Objects.plist"]; NSString *bundle = [[NSBundle mainBundle] pathForResource:@"Objects" ofType:@"plist"]; NSFileManager *fileManager = [NSFileManager defaultManager]; if (![fileManager fileExistsAtPath: path]) { [fileManager copyItemAtPath:bundle toPath:path error:&error]; } else { NSArray *bundleArray = [[NSArray alloc] initWithContentsOfFile:bundle]; NSMutableArray *documentArray = [[NSMutableArray alloc] initWithContentsOfFile:path]; BOOL updateDictionary = NO; for(int i=0;i<bundleArray.count;i++) { NSDictionary *bundleDict=[bundleArray objectAtIndex:i]; BOOL matchInDocuments = NO; for(int ii=0;ii<documentArray.count;ii++) { NSMutableDictionary *documentDict = [documentArray objectAtIndex:ii]; NSString *bundleObjectName = [bundleDict valueForKey:@"Name"]; NSString *documentsObjectName = [documentDict valueForKey:@"Name"]; NSRange range = [documentsObjectName rangeOfString:bundleObjectName options:NSCaseInsensitiveSearch]; if (range.location != NSNotFound) { matchInDocuments = YES; } if (matchInDocuments) { if ([bundleDict objectForKey:@"District"] != [documentDict objectForKey:@"District"]) { [documentDict setObject:[bundleDict objectForKey:@"District"] forKey:@"District"]; updateDictionary=YES; } } else { [documentArray addObject:bundleDict]; updateDictionary=YES; } } } if(updateDictionary){ [documentArray writeToFile:path atomically:YES]; } } } If I run my app now I get this message: '-[__NSCFDictionary setObject:forKey:]: mutating method sent to immutable object' How can I fix this? When this is fixed, do you think my code will work? If not, I would be happy for some suggestions on how to do this. I have struggled for a while and really need to publish the update with the corrections! Thanks a lot for your help.

    Read the article

  • Show and Fade UIImageView after 2 Seconds

    - by user1536432
    I am working on a notification system in my iPhone game and want an image to pop up on the screen and automatically fade after 2 seconds. User clicks a button that calls the method "popupImage" An image appears on the screen in a designated spot, it doesn't need to fade in The image fades out by itself after being on the screen for 2 seconds. Is there any way of doing this? Thanks ahead of time.

    Read the article

  • cellForRowAtIndexPath not being called, but rowsInSections is and it's delegate is set

    - by Jhorra
    I searched around prior to posting this and made sure I hadn't missed anything obvious, though I have a feeling I am missing something basic. I'm using this as a sidebar navigation view. I tried making them static cells and pre-populating them, but they were blank that way as well. When I do it this way I can see everything gets called except that. I've tried deleting it and re-adding it. #import "acxSideBarController.h" @interface acxSideBarController () @end @implementation acxSideBarController @synthesize sidebarDelegate = _sidebarDelegate; - (id)initWithStyle:(UITableViewStyle)style { self = [super initWithStyle:style]; if (self) { // Custom initialization } return self; } - (void)viewDidLoad { [super viewDidLoad]; if ([self.sidebarDelegate respondsToSelector:@selector(lastSelectedIndexPathForSidebarViewController:)]) { NSIndexPath *indexPath = 0; [self.tableView selectRowAtIndexPath:indexPath animated:NO scrollPosition:UITableViewScrollPositionNone]; } self.tableView.backgroundColor = [UIColor underPageBackgroundColor]; self.tableView.dataSource = self; self.tableView.delegate = self; } - (void)viewDidUnload { [super viewDidUnload]; } - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; } - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return (interfaceOrientation == UIInterfaceOrientationPortrait); } #pragma mark - Table view data source - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { return 3; } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { if(section == 0) return 2; else if(section == 1) return 1; else return 1; } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"linkCell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier]; } NSString *name = @""; if(indexPath.section == 1) name = @"Inbox"; else if(indexPath.section == 2) name = @"Logout"; else { if(indexPath.row == 0) name = @"Roster"; else if(indexPath.row == 1) name = @"Environmental Variables"; } cell.textLabel.text = name; cell.textLabel.textColor = [UIColor darkTextColor]; return cell; } - (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section { if(section == 0) return @"Students"; else if(section == 1) return @"Communication"; else return @" "; } #pragma mark - Table view delegate - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { if (self.sidebarDelegate) { [self.sidebarDelegate acxSideBarController:self atIndexPath:indexPath]; } } @end If it's helpful here's the header file #import <UIKit/UIKit.h> @protocol acxSideBarControllerDelegate; @interface acxSideBarController : UITableViewController @property (nonatomic, assign) id <acxSideBarControllerDelegate> sidebarDelegate; @end @protocol acxSideBarControllerDelegate <NSObject> - (void)acxSideBarController:(acxSideBarController *)acxSideBarController atIndexPath:(NSIndexPath *)indexPath; @optional - (NSIndexPath *)lastSelectedIndexPathForacxSideBarController:(acxSideBarController *)acxSideBarController; @end

    Read the article

  • Core Data Predicate To Many

    - by Vikings
    I have a core data model that has a one to many relationship, there is a category, and it can contain many subcategories. Category <---- Subcategory I am trying to perform a fetch that checks if a particular Category contains a Subcategory with a particular name. Let's say I have two categories below, I want to fetch to see if there are any subcategories name "Apple" in the Category named "Fruits". Vetegables - Carrot - Lettuce Fruits - Apple - Orange - Pear Code: - (SubCategory *)searchForSubCategoryWithName:(NSString *)subCategory inCategory:(Category *)category { NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init]; NSEntityDescription *entity = [NSEntityDescription entityForName:@"SubCategory" inManagedObjectContext:self.beer.managedObjectContext]; [fetchRequest setEntity:entity]; NSPredicate *predicate = [NSPredicate predicateWithFormat:@"name == [c] %@", subCategory]; [fetchRequest setPredicate:predicate]; NSError *error; NSArray *fetchedObjects = [self.beer.managedObjectContext executeFetchRequest:fetchRequest error:&error]; if (fetchedObjects != nil && fetchedObjects.count > 0) { return [fetchedObjects objectAtIndex:0]; } else { return nil; } }

    Read the article

  • How to fix a slow scrolling table view

    - by hanumanDev
    I have a table view that's scrolling slowly. Does anyone know why that might be? There is an image for each row, but even after the images are loaded it still stutters and scrolls slowly. thanks for any help here's my code: - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *simpleTableIdentifier = @"SimpleTableCell"; SimpleTableCell *cell = (SimpleTableCell *)[tableView dequeueReusableCellWithIdentifier:simpleTableIdentifier]; if (cell == nil) { NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"SimpleTableCell" owner:self options:nil]; cell = [nib objectAtIndex:0]; } // Get item from tableData NSDictionary *item = (NSDictionary *)[displayItems objectAtIndex:indexPath.row]; // display the youdeal deal image photoString = [item objectForKey:@"image"]; UIImage *image = [UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:photoString]]]; cell.titleLabel.text = [item objectForKey:@"supercat"]; cell.descriptionLabel.text = [item objectForKey:@"title"]; NSString *convertedLeftCount = [NSString stringWithFormat:@"%@",[item objectForKey:@"left_count"]]; cell.amountLabel.text = convertedLeftCount; cell.thumbnailImageView.image = image; cell.priceLabel.text = [item objectForKey:@"cat"]; return cell; }

    Read the article

  • iAd banner gives warning when pushed off screen by navController

    - by James Dunay
    I have a iAd that seems to be correctly displaying but when push a new view controller into the view i get a warning from the iAd that says it has been: WARNING A banner view (0x490fd0) has an ad but may be obscured. This message is only printed once per banner view. But the ad still runs fine so should i pay attention to this? I just tried adding self.adBannerView = nil; [adBannerView release];` just before i push the viewController but i still get that error

    Read the article

  • what's the right way to cause a subview to redraw when the device orientation changes?

    - by RobertL
    I have a view controller with a view and one subview. When the device orientation changes the view auto-redraws but the subview doesn't. If I explicitly do [subview setNeedsDisplay] it redraws but I don't have a logical place to put that call in my code. And, since I don't have to explicitly tell the view to redraw, it seems counter-intuitive to tell the subview to redraw. Is there a way to make the subview auto-redraw when the view redraws?

    Read the article

  • Why do I get "2010-01-01 00:00:00 +900" from "2010-12-31 15:00:00 +000"?

    - by mikezang
    I have NSDate, it will be shown as below if I used NSLog(@"%@", date.description); 2010-12-31 15:00:00 +0000 it will be shown as if I used NSLog(@"%@", [date descriptionWithLocale:[[NSLocale currentLocale] localeIdentifier]]); Saturday, January 1, 2011 12:00:00 AM Japan Standard Time But it will be show as below if I used NSLog(@"%@", [date formattedDateString]); 2010-01-01 00:00:00 +0900 Where do I make mistake? (NSString *)formattedDateString { return [self formattedStringUsingFormat:@"YYYY-MM-dd HH:mm:ss ZZZ"]; } (NSString *)formattedStringUsingFormat:(NSString *)dateFormat { NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; [formatter setDateFormat:dateFormat]; NSString *ret = [formatter stringFromDate:self]; [formatter release]; return ret; }

    Read the article

  • iOS6: do we have to set rootViewController in App delegate in order to support different orientations?

    - by Centurion
    The app was perfectly fine working in iOS5 in landscape orientation. However in iOS6, it started to use portrait orientation in all view controllers. The methods shouldAutorotateToInterfaceOrientation are not called anymore. I read the new stuff about changed rotation mechanism in iOS6 and I was able to fix that by adding a line in my AppDelegate: self.window.rootViewController = _viewController _viewControler is the starting screen (Home-menu). All other view controllers implement shouldAutorotateToInterfaceOrientation method and returns YES for landscape orientations only. So, it's perfectly working solution for the app that needs to support only one orientation. However, the problem is I need one view controller (lets call it phone-VC) to be presented in portrait orientation. Now, if I want this view controller would be rotated then I need to return YES in Home-menu controller that is assigned to rootViewControler in appDelegate. However, I can't do that because this rootViewController is starting window that need to presented in landscape only, otherwise the layout with graphics in this window will break. But if I don't return YES from its shouldAutorotateToInterfaceOrientation (Home-menu) then the same method is not called in my view phone-VC that needs to be presented in portrait. Any ideas? Does the assignation of rootViewController is mandatory in AppDelegate? UPDATE: the problem exists on device (at least on iPhone4).

    Read the article

< Previous Page | 52 53 54 55 56 57 58 59 60 61 62 63  | Next Page >