Search Results

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

Page 64/108 | < Previous Page | 60 61 62 63 64 65 66 67 68 69 70 71  | Next Page >

  • Core Data to-many relationship in code

    - by Jan Bezemer
    I have three entities: Session, User and Test. A session has 0-many users and a user can perform 0-6 tests. (I say 0 but in the real application always at least 1 is required, at least 1 user for a session and at least 1 test for a user. But I say 0 to express an empty start.) All entities have their own specific data attributes too. A user has a name, A session has a name, a test has six values to be filled in by the user, and so on. But my issue is with the relationships. How do I set multiple users and have them added to one session (same goes for multiple tests for one user). How do I show the content in a right way? How do I show a session that has multiple users and these users having completed multiple tests? Here's my code so far with regard to issue 1: Session *session = [NSEntityDescription insertNewObjectForEntityForName:@"Session" inManagedObjectContext:context]; session.name = @"Session 1"; User *users = [NSEntityDescription insertNewObjectForEntityForName:@"User" inManagedObjectContext:context]; users.age = [NSNumber numberWithInt:28]; users.session = session; //sessie.users = users; [sessie addUserObject:users]; With regard to issue 2: I can log the session, but I can't get the user(s) logged from a session. NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init]; NSEntityDescription *entity = [NSEntityDescription entityForName:@"Session" inManagedObjectContext:context]; [fetchRequest setEntity:entity]; NSArray *fetchedObjects = [context executeFetchRequest:fetchRequest error:&error]; for (Session *info in fetchedObjects) { NSLog(@"Name: %@", info.name); NSLog(@"Having problems with this: %@",info.user); //User *details = info.user; //NSLog(@"User: %@", details.age); }

    Read the article

  • How to use Devicemotion/Gyroscope to move a dot from center to 8 directions of iphone screen

    - by iSeeker
    I am trying to move a dot at center to 8 directions of iphone screen using Devicemotion such that it moves faster when tilted at a faster rate. Rough sketch is below: I could find a similar implementation in an app called Gyrododge in appstore, i cant figure out how to make it work... Update: This is what i have done so far, but the response is not smooth, and is very jittery.. xdiff and ydiff are the change of device attitude in x and y directions, derived from quatenion implementation. if (currDeviceMotion.rotationRate.x < -2) { NSLog(@"To Top"); if (195+800*ydiff >=193 && 195+800*ydiff <= 197) { [self.pitchDot setFrame:CGRectMake(150, 195, 20, 20)]; }else{ if (195+800*ydiff >=390 ) { [self.pitchDot setFrame:CGRectMake(150, 390, 20, 20)]; }else if (195+800*ydiff <= 0){ [self.pitchDot setFrame:CGRectMake(150, 0, 20, 20)]; }else if(195+800*ydiff < 194){ [self.pitchDot setFrame:CGRectMake(150, 195+800*ydiff, 20, 20)]; }else if(195+800*ydiff > 196){ [self.pitchDot setFrame:CGRectMake(150, 195+800*ydiff, 20, 20)]; } } }else if (currDeviceMotion.rotationRate.x > 2){ NSLog(@"To Bottom"); if (195+800*ydiff >=193 && 195+800*ydiff <= 197) { [self.pitchDot setFrame:CGRectMake(150, 195, 20, 20)]; }else{ if (195+800*ydiff >=390 ) { [self.pitchDot setFrame:CGRectMake(150, 390, 20, 20)]; }else if (195+800*ydiff <= 0){ [self.pitchDot setFrame:CGRectMake(150, 0, 20, 20)]; }else if(195+800*ydiff < 194){ [self.pitchDot setFrame:CGRectMake(150, 195+800*ydiff, 20, 20)]; }else if(195+800*ydiff > 196){ [self.pitchDot setFrame:CGRectMake(150, 195+800*ydiff, 20, 20)]; } } }else if (currDeviceMotion.rotationRate.y < -2){ NSLog(@"To Left"); if (150+500*xdiff >= 148 && 150+500*xdiff <=152) { [self.pitchDot setFrame:CGRectMake(150, 195, 20, 20)]; }else{ if (150+500*xdiff >= 300 ) { [self.pitchDot setFrame:CGRectMake(300, 195, 20, 20)]; }else if (150+500*xdiff <= 0){ [self.pitchDot setFrame:CGRectMake(0, 195, 20, 20)]; }else if(150+500*xdiff < 148){ [self.pitchDot setFrame:CGRectMake(150+500*xdiff, 195, 20, 20)]; }else if(150+500*xdiff > 152){ [self.pitchDot setFrame:CGRectMake(150+500*xdiff, 195, 20, 20)]; } } }else if (currDeviceMotion.rotationRate.y > 2){ NSLog(@"To Right"); if (150+500*xdiff >= 148 && 150+500*xdiff <=152) { [self.pitchDot setFrame:CGRectMake(150, 195, 20, 20)]; }else{ if (150+500*xdiff >= 300 ) { [self.pitchDot setFrame:CGRectMake(300, 195, 20, 20)]; }else if (150+500*xdiff <= 0){ [self.pitchDot setFrame:CGRectMake(0, 195, 20, 20)]; }else if(150+500*xdiff < 148){ [self.pitchDot setFrame:CGRectMake(150+500*xdiff, 195, 20, 20)]; }else if(150+500*xdiff > 152){ [self.pitchDot setFrame:CGRectMake(150+500*xdiff, 195, 20, 20)]; } } }else if (currDeviceMotion.rotationRate.x < -0.20 && currDeviceMotion.rotationRate.y > 0.20 ){ NSLog(@"To Diagonal Right Top"); if (150+650*xdiff >= 148 && 150+650*xdiff <=152) { [self.pitchDot setFrame:CGRectMake(150, 195, 20, 20)]; }else{ if (150+650*xdiff >= 300 ) { [self.pitchDot setFrame:CGRectMake(300, 0, 20, 20)]; }else if(150+650*xdiff > 152){ [self.pitchDot setFrame:CGRectMake(150+650*xdiff, 195-1.3*650*xdiff, 20, 20)]; } } }else if (currDeviceMotion.rotationRate.x > 0.20 && currDeviceMotion.rotationRate.y < -0.20 ){ NSLog(@"To Diagonal Left Bottom"); if (150+650*xdiff >= 148 && 150+650*xdiff <=152) { [self.pitchDot setFrame:CGRectMake(150, 195, 20, 20)]; }else{ if (150+650*xdiff <= 0 ) { [self.pitchDot setFrame:CGRectMake(0, 390, 20, 20)]; }else if(150+650*xdiff < 148){ [self.pitchDot setFrame:CGRectMake(150+650*xdiff, 195-1.3*650*xdiff, 20, 20)]; } } }else if (currDeviceMotion.rotationRate.x < -0.20 && currDeviceMotion.rotationRate.y < -0.20 ){ NSLog(@"To Diagonal Left Top and xdiff is %f",xdiff); if (150+650*xdiff >= 148 && 150+650*xdiff <=152) { [self.pitchDot setFrame:CGRectMake(150, 195, 20, 20)]; }else{ if (150+650*xdiff <= 0 ) { [self.pitchDot setFrame:CGRectMake(0, 0, 20, 20)]; }else if(150+650*xdiff < 148){ [self.pitchDot setFrame:CGRectMake(150+650*xdiff, 195+1.3*650*xdiff, 20, 20)]; } } }else if (currDeviceMotion.rotationRate.x > 0.20 && currDeviceMotion.rotationRate.y > 0.20 ){ NSLog(@"To Diagonal Right Bottom"); if (150+650*xdiff >= 148 && 150+650*xdiff <=152) { [self.pitchDot setFrame:CGRectMake(150, 195, 20, 20)]; }else{ if (150+650*xdiff >= 300 ) { [self.pitchDot setFrame:CGRectMake(300, 390, 20, 20)]; }else if(150+650*xdiff > 152){ [self.pitchDot setFrame:CGRectMake(150+650*xdiff, 195+1.3*650*xdiff, 20, 20)]; } } }else if((currDeviceMotion.rotationRate.x < 0.20 && currDeviceMotion.rotationRate.x < -0.20) ||(currDeviceMotion.rotationRate.y < 0.20 && currDeviceMotion.rotationRate.y < -0.20) ||(currDeviceMotion.rotationRate.z < 0.20 && currDeviceMotion.rotationRate.z < -0.20)){ [self.rollDot setFrame:CGRectMake(150, 195, 20, 20)]; [self.pitchDot setFrame:CGRectMake(150, 195, 20, 20)]; } It could be great if i could make it move like the application i have stated above, called Gyrododge This link also addresses a similar question:Link. Any advice or help is greatly appreciated... Thanks.

    Read the article

  • How to iterate & retrieve values from NSArray of NSArrays of NSDictionaries

    - by chinjazz
    I'm stumpped on how iterate and get values for an Array of Arrays of NSDictionaries (different classes/entities). Here's what I'm currently doing: 1) Constructing two separate arrays of NSDictionaries (different entities) 2) Combining both arrays with: NSMutableArray *combinedArrayofDicts = [[NSMutableArray alloc] initWithObjects: sizesArrayOfDicts, wishListArrayOfDicts , nil]; 3) Then archive combinedArrayofDicts : NSData *dataToSend = [NSKeyedArchiver archivedDataWithRootObject:combinedArrayofDicts]; 4) Transmit over GameKit [self.session sendDataToAllPiers:dataToSend withDataMode: GKSendDataReliable error:nil]; 5) How would I manage traversing thru this array on the receiving end? I want to fetch values by for each class which is key'ed by classname: Here's how it looks via NSLog (2 Sizes Dicts, and 1 Wishlist Dict) Printing description of receivedArray: <__NSArrayM 0xbc65eb0>( <__NSArrayM 0xbc651f0>( { classname = Sizes; displayOrder = 0; share = 1; sizeType = Neck; value = "13\" or 33 (cm)"; }, { classname = Sizes; displayOrder = 0; share = 1; sizeType = Sleeve; value = "34\" or 86 (cm)"; } ) , <__NSArrayM 0xbc65e80>( { classname = Wishlist; detail = ""; displayOrder = 0; imageString = ""; latitude = "30.33216666666667"; link = "http://maps.google.com/maps?q=loc:30.332,-81.41"; longitude = "-81.40949999999999"; name = bass; share = 1; store = ""; } ) ) (lldb) In my for loop I'm issuing this: NSString *value = [dict objectForKey:@"classname"]; and get an exception: * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSArrayM objectForKey:]: unrecognized selector sent to instance 0xbc651f0' Is this frowned upon as far as mixing object types in arrays of arrays?

    Read the article

  • Passing data from one viewcontroller to another

    - by user1392515
    I subclassed two view controllers. The first one is supposed to pass data, a NSUrl object to the second one. .m of the first one: NSURL *temp = [NSURL URLWithString:@"http://example.com"]; UIViewController *presentationsFullScreen_ViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"PresentationsFullScreen_ViewController"]; presentationsFullScreen_ViewController.urlToUse = temp; .h of the second one: #import <UIKit/UIKit.h> @interface PresentationsFullScreen_ViewController : UIViewController { NSURL *urlToUse; } @property (nonatomic,retain) NSURL *urlToUse; It is obviously not working and not compiling,telling me essentially that I didn't subclass it and that the property urlToUse is not found on UIViewController. How do I subclass correctly? Thanks!

    Read the article

  • collapsing a UITableView

    - by Sage Washabaugh
    Hey everyone I made a UITableView in my app and when a cell is touched it expands the problem I am having is it does not collapse no matter what I have tried, I'm sure its something easy i just cant figure it out the only time it does collapse is when it another cell is tapped. Here is my code: -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { selectedCellIndexPath = indexPath; [tableView reloadRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationNone]; if (selectedCellIndexPath) { selected = YES; } } -(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { if(selectedCellIndexPath != nil && [selectedCellIndexPath compare:indexPath] == NSOrderedSame) return 150; return 44; }

    Read the article

  • iDevice for Dummies: Can a device be assigned multiple provisions (Personal/Enterprise)?

    - by Alex
    Hi guys, Is it possible to assign multiple provisions to an iDevice? To be honest, I'm not sure if I'm using the correct terminology, but basically, I'm developing an iPad app for a company and I've only been testing it in the simulator because I don't have a registration to the developer program and they haven't setup their enterprise registration yet either. And I'm sure you all know how limited the simulator is... I don't really care about the $99 it costs to join, but what I'm worried about is having my iDevices locked permanently to my personal registration and unable to switch back and forth to the enterprise registration. I'd appreciate it if someone can explain to me how the registrations work. And keep in mind, I'm a dummy. :) Thanks in advance!

    Read the article

  • How to increase Size of PhotoLibrary View in iPad?

    - by Shreedhar
    Folwing code is to pop photoLibrary videoPicker = [[UIImagePickerController alloc] init]; videoPicker.delegate = self; videoPicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; videoPicker.mediaTypes = [NSArray arrayWithObjects:(NSString *) kUTTypeImage,(NSString *)kUTTypeMovie,nil]; videoPicker.allowsEditing = YES;; pop = [[UIPopoverController alloc]initWithContentViewController:videoPicker]; pop.popoverContentSize = CGSizeMake(500, 900); [pop setDelegate:self]; [pop presentPopoverFromRect:[sender frame] inView:self.view permittedArrowDirections:UIPopoverArrowDirectionDown animated:YES]; [videoPicker release]; How to increase the photoLibrary view(width X height) on pop?

    Read the article

  • TableView Background image going over cell textLabel

    - by Alex Trott
    Currently my tableview looks like this: as you can see, cell.textLabel and cell.detailTextLable both load this background, and i can't work out how to get them to stop loading the background, and for it only to be the backing on the cell. Here's my current code to change the cell: - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath { [cell setBackgroundColor:[UIColor colorWithPatternImage:[UIImage imageNamed:@"tableCell.png"]]]; } How can i get round this problem? Thanks in advance.

    Read the article

  • UITableView cell selection disabled and UITableViewHeader Enabled

    - by andyPaul
    I am adding a my header view to self.tableView.tableHeaderView=headerView; This tableView has 10 cells. I want to disable the cell Selection but, headerView touch events must be enabled. To achieve this I added the following code: self.tableView.userInteractionDisabled=YES; self.headerView.userInteractionDisabled=NO; self.headerView.exclusiveTouch=YES; Where I am wrong? Basic idea of implementation is , If headerView is enabled then cell selection is disabled and vice-versa.

    Read the article

  • Download files with NSURL

    - by Ishwar
    I am trying to download a list of files from a ftp server using: NSURL *ftpUrl = [NSURL URLWithString:@"ftp://xxx:[email protected]"]; I HAVE to use FTP, so please do not recommend an alternative. I want to know how to get the list of files from the root directory and also navigate inside folders (of FTP server). P.S: I do not think external library would be required to accomplish such an easy task, but if I must, any recommendations would be appreciated. Thank You :)

    Read the article

  • How to check in which position (landscape or portrait) os the iPhone now?

    - by Knodel
    I have an app with a tab bar, and nav controllers in each tab. When user shakes the device, a UIImageView appears as a child view in the nav controller. But the UIImageView must contain a special image, depending on the device's current orientation. If I write just - (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation) if (interfaceOrientation == UIInterfaceOrientationPortrait|| interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown) { //Code } else if (interfaceOrientation == UIInterfaceOrientationLandscapeRight||interfaceOrientation == UIInterfaceOrientationLandscapeLeft) { //Code } } The view just goes crazy if user rotated the device before shaking. Is there a method to get iPhones current orientation?

    Read the article

  • Use pushViewController within app Delegate

    - by FMT
    Hi there i want to use this code within the app delegate ChatController *chatController = [[AppDelegate appDelegate] instantiateViewControllerWithIdentifier:@"GroupController"]; chatController.targetUserid = userid; [self.navigationController pushViewController:groupChatController animated:YES]; how can i push viewcontroller from appdelegate i mean make the above code work cuz self.navigationcontroller doesnt work :$

    Read the article

  • Pass NSURL from One Class To Another

    - by user717452
    In my appDelegate in didFinishLaunchingWithOptions, I have the following: NSURL *url = [NSURL URLWithString:@"http://www.thejenkinsinstitute.com/Journal/"]; NSString *content = [NSString stringWithContentsOfURL:url]; NSString * aString = content; NSMutableArray *substrings = [NSMutableArray new]; NSScanner *scanner = [NSScanner scannerWithString:aString]; [scanner scanUpToString:@"<p>To Download the PDF, " intoString:nil]; // Scan all characters before # while(![scanner isAtEnd]) { NSString *substring = nil; [scanner scanString:@"<p>To Download the PDF, <a href=\"" intoString:nil]; // Scan the # character if([scanner scanUpToString:@"\"" intoString:&substring]) { // If the space immediately followed the #, this will be skipped [substrings addObject:substring]; } [scanner scanUpToString:@"" intoString:nil]; // Scan all characters before next # } // do something with substrings NSString *URLstring = [substrings objectAtIndex:0]; self.theheurl = [NSURL URLWithString:URLstring]; NSLog(@"%@", theheurl); [substrings release]; The console printout for theheurl gives me a valid URL ending in .pdf. In the class I would like to load the URL, I have the following: - (void)viewWillAppear:(BOOL)animated { _appdelegate.theheurl = currentURL; NSLog(@"%@", currentURL); NSLog(@"%@", _appdelegate.theheurl); [worship loadRequest:[NSURLRequest requestWithURL:currentURL cachePolicy:NSURLRequestReloadIgnoringLocalCacheData timeoutInterval:60.0]]; timer = [NSTimer scheduledTimerWithTimeInterval:(1.0/2.0) target:self selector:@selector(tick) userInfo:nil repeats:YES]; [super viewWillAppear:YES]; } However, both NSLogs in that class come back null. What am I Doing wrong in getting the NSURL from the AppDelegate to the class to load it?

    Read the article

  • Listing documents directory contents in UITableView

    - by user1493543
    So I've researched extensively on how to list the files in the documents directory in a table view and after much deliberation, came up with this code. Whenever I run this, the app crashes with EXEC_BAD_ACCESS. I've been busting my head for hours, so any help would be appreciated. All I'm doing is acquiring the files in the documents directory and trying to list them in a table view... Code is pasted in link below. http://pastie.org/4178767 Edit- App crashes in numberOfRowsInSection: method.

    Read the article

  • Add a hidden view above a UITableView that is only displayed when TableView is scrolled up

    - by noncogitas
    Goal/Situation: I currently have a UIView in the TableView header. I am trying to add another UIView (which contains two Buttons and a few TextFields) that will sit above the TableView header. I would like the view to be displayed when the user scrolls up past the header (a la "pull to refresh"), and go away when the user presses a "done" button on the view. My two questions: 1) How do I add a view above the tableview header? 2) How do I display said view when a user has scrolled up past the header? 3) How do I dismiss said view when the user has pressed a button on said view?

    Read the article

  • Find the end/finish coordinates you a UISwipeGestureRecognizer

    - by Code
    I can find the start coordinates of where a swipe starts by doing the following - (void)oneFingerSwipeUp:(UISwipeGestureRecognizer *)recognizer { CGPoint point = [recognizer locationInView:[self view]]; NSLog(@"Swipe up - start location: %f,%f", point.x, point.y); } Is it possible to find the coordinates where the swipe ended? I looked into the docs and its not mentioned. Is there some work around for this? Many Thanks, -Code

    Read the article

  • Get current location using CLLocationCoordinate2D

    - by Mobility
    I am trying to get current location of user using CLLocationCoordinate2D. I want the values in the format like CLLocationCoordinate2D start = {-28.078694,153.382844 }; So that I can use them like following: NSString *urlAddress = [NSString stringWithFormat:@"http://maps.google.com/?saddr=%1.6f,%1.6f&daddr=%1.6f,%1.6f", start.latitude, start.longitude, destination.latitude, destination.longitude]; I used CLLocation *location = [[CLLocation alloc]init ]; CLLocationDegrees currentLatitude = location.coordinate.latitude; CLLocationDegrees currentLongitude = location.coordinate.longitude; to get current lat & long. But I am getting 0.000 for both when I try to test. I am testing on iPhone 4s. If there is any sample code, it will be great.

    Read the article

  • iPhone to Java EE remoting

    - by Justin Simonelis
    Hi there! I was looking for some opinions on the best remote method invocation practices when developing iPhone applications that communicate with Java (java EE) servers. Many iphone applications these days typically talk to a server back end. I typically prefer to write my servers in java using some Spring libraries. So far I have not found or stuck to a definitive practice for iphone-java server communication. What are some technical solutions and libraries that you have used to implement this kind of client-server communication? One thing I always keep in mind is that I want the communication protocols to be simple so that multiple platforms can be added for example, in future adding Android and possibly Blackberry clients, that can use the same protocol to talk to the server.

    Read the article

  • Rendering CALayer in context uses large amounts of memory

    - by Otium
    I am taking a snapshot of a UIWebView layer, but when I render the webview's layer in the current context my app uses 10mb more memory, and I don't think that should be right. Here is my current code: CGSize imageSize = self.bounds.size; UIGraphicsBeginImageContextWithOptions(imageSize, YES, 0); CGContextRef context = UIGraphicsGetCurrentContext(); [self.layer renderInContext:context]; _snapshot = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext();

    Read the article

  • why i change the alpha value of UIImageView but no effect?

    - by chancy
    I am working on a reader app. when you read one magazine, it will display first five pages and download the rest pages one by one. there is a scrollview to view the thumbnail image of pages. At the beginning, if the page needs downloading, the corresponding thumbnail view's alpha value is set to 0.5. when the page is downloaded, i will update the thumbnail view's value to 1.0. I use one operation to download the page, and when one is downloaded i use delegate to set thumbnail view's alpha. But when i update thumbnail view's alpha value, it still the same as the beginning. it seems the alpha has no effect. I wonder is there anything wrong with my code? some snippets are as follows: In the PageViewController.m - (void)downloadPages { DownloadOperation *op = [[DownloadOperation alloc] initWithMagazine:magazine]; op.delegate = self; [[(AppDelegate *)[[UIApplication sharedApplication] delegate] sharedOperationQueue] addOperation:op]; } - (void)downloadOperation:(DownloadOperation *)operation finishedAtIndex:(NSUInteger)index { if (thumbScrollView){ [thumbScrollView viewWithTag:THUMBVIEW_OFFSET+index].alpha = 1.0; } } In DownloadOperation.m - (void)main { // ... NSUInteger index = 0; for (Page *page in mMagazine.pages) { if (/*page doesn't exist*/){ // download the page; if ([delegate respondsToSelector:@selector(downloadOperation:finishedAtIndex:)]) { [delegate downloadOperation:self finishedAtIndex:index]; } } index++; } }

    Read the article

  • does Apple allow template style apps to pass review?

    - by user1159677
    I have an app which will go to our clients and then they can have their clients install it. Meaning there would be multiple versions of the master app but with customization per client. example 200 of our clients get the master app and then can customize it (text and images only via web) Will Apple allow something like this? Is there another way to get around this distribution model? I guess a good example of it would be a real estate agent having an app that's customized and on the app store but it's still Brand XYZ's app. thanks in advance

    Read the article

  • how can i show ccessarychecked cell values in alertbox

    - by adnan
    i have created uitableview and cell in uitableview are accessarychecked . i have implemented an action named -(IBAction) checkBoxClicked . what i need is that i wanted to show accessarychecked cell values in alertbox when i click on button this is the code which i have written #import "ViewController.h" @implementation ViewController @synthesize cell; - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return 7; } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { cell= [tableView dequeueReusableCellWithIdentifier:@"cell"]; if (cell == nil) { cell = [[ UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cell"]; } cell.textLabel.text = [myarray objectAtIndex:indexPath.row]; /* NSString *imagefile = [[NSBundle mainBundle] pathForResource:@"cellimage" ofType:@"png"]; UIImage *ui = [[UIImage alloc] initWithContentsOfFile:imagefile]; cell.imageView.image = ui;*/ NSString *check = [[NSBundle mainBundle] pathForResource:@"checkbox_not_ticked" ofType:@"png"]; UIImage *bi = [[UIImage alloc] initWithContentsOfFile:check]; cell.imageView.image = bi; cell.accessoryType = UITableViewCellAccessoryNone; return cell; [cell release]; } - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { cell = [tableView cellForRowAtIndexPath:indexPath]; if (cell.accessoryType == UITableViewCellAccessoryNone) { cell.accessoryType = UITableViewCellAccessoryCheckmark; } else { cell.accessoryType = UITableViewCellAccessoryNone; } } -(IBAction) checkBoxClicked { NSArray *array = [[NSArray alloc] initWithArray:[myarray objectAtIndex:cell.accessoryType]:UITableViewCellAccessoryCheckmark]; if (array.cell.accessoryType == UITableViewCellAccessoryCheckmark) { UIAlertView *msg = [[ UIAlertView alloc] initWithTitle:@"selected items are given: " message:array delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil ]; [msg show ]; [msg release]; [myarray release]; } } //-(IBAction)checkBoxClicked{} - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Release any cached data, images, etc that aren't in use. } #pragma mark - View lifecycle - (void)viewDidLoad { myarray = [[NSArray alloc] initWithObjects:@"mondey",@"tuesday", @"wednesday",@"thursday",@"friday",@"saturday",@"sundey", nil]; [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. } - (void)viewDidUnload { [myarray release]; [super viewDidUnload]; // Release any retained subviews of the main view. // e.g. self.myOutlet = nil; } - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; } - (void)viewDidAppear:(BOOL)animated { [super viewDidAppear:animated]; } - (void)viewWillDisappear:(BOOL)animated { [super viewWillDisappear:animated]; } - (void)viewDidDisappear:(BOOL)animated { [super viewDidDisappear:animated]; } - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { // Return YES for supported orientations return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown); } @end

    Read the article

  • how to change the image on click from database

    - by iosdev
    In my application i having multiple image in sq lite database,Since i want to change to the next image on button click,Here my code, -(void)Readthesqlitefile:(NSInteger *)sno { sqlite3 *database;//database object NSString *docpath=[self doccumentspath];//get sqlite path const char *ch=[docpath UTF8String];//string to constant char UTF8string main part to connect DB if (sqlite3_open(ch, &database)==SQLITE_OK) { const char *chstmt="SELECT * FROM animal where rowid= = %d",sno; sqlite3_stmt *sqlstmt;//to execute the above statement if (sqlite3_prepare_v2(database, chstmt, -1, &sqlstmt, NULL)==SQLITE_OK) { while (sqlite3_step(sqlstmt)==SQLITE_ROW) { const char *Bname=(char *)sqlite3_column_text(sqlstmt, 0); //converting const char to nsstring NSString *Bndname=[NSString stringWithFormat:@"%s",Bname]; NSLog(@"Brand Names=%@",Bndname); lb1.text=[NSString stringWithFormat:Bndname]; NSUInteger legnt=sqlite3_column_bytes(sqlstmt, 1); if (legnt>0) { NSData *dt=[NSData dataWithBytes:sqlite3_column_blob(sqlstmt, 1) length:legnt]; clsimg=[UIImage imageWithData:dt];//converting data to image imager.image=clsimg; } else { clsimg=nil; } } } sqlite3_finalize(sqlstmt); } sqlite3_close(database); } Button click function -(IBAction)changenext { int j; for (j=1; j<10; j++) { [self Readthesqlitefile:j]; } } its is not working pls help me to solve it out?

    Read the article

  • One Common View In Every ViewController

    - by l3v
    I am having a hard time wording this when searching the internet so I am just going to ask the question. I have an options view in my app that slides into view when the user clicks a button. This options view will display app information like settings. I want this options view to be displayed on every view controller in my app. I do not want to copy and paste the code for the options view into every viewcontroller file. The options view has quite a few outlets and actions and also calls many delegates. How can I reuse this options view in all my view controllers without adding all the outlets, actions, and delegate methods each time? I was going to make a new file with public methods, but I would still have to copy the outlets. Would this public methods file have to include delegate methods as well then? Let me know if my question does not make sense. I am hoping there is a standard way of implementing something like this.

    Read the article

  • I have submitted app to app store and app status came like 'Metadata Rejected' and following review status. I do not have login page

    - by user3717465
    We began the review of your app but are not able to continue because we need a demo account to fully access your app features. Please provide demo account details in the Review Notes section of the Version Information for your app. Please ensure that the information you provide includes any data necessary to demonstrate the functionality of your app features. You can provide demo account information, including passwords, in the Review Notes section of your iTunes Connect App Information. While your iTunes Connect Application State shows as Metadata Rejected, we don't require a new binary to correct this issue. Please visit iTunes Connect, Manage Your Applications. Select your app, then click View Details of the desired version. Click the Edit button next to Version Information to edit the Review Notes for your app, then click "Save". how to correct the meta data. because i do not have login account.

    Read the article

< Previous Page | 60 61 62 63 64 65 66 67 68 69 70 71  | Next Page >