Search Results

Search found 15866 results on 635 pages for 'iphone 4g'.

Page 162/635 | < Previous Page | 158 159 160 161 162 163 164 165 166 167 168 169  | Next Page >

  • Objective C: Include class and call method

    - by Nic Hubbard
    I have built a class which has a few methods in it, once of which returns an array, lets call this class A. I have a second class, class B, which I would like to use to call the method from class A. But, now how do I call that method from class A and store what is returned in a var in class B? Do I have to initiate the class? I have made sure to include the .h file from class A into class B. Thanks for helping a newbie.

    Read the article

  • page looping in UIScrollview?

    - by senthilmuthu
    hi, i am using Scrollviewmadness sample, they have used pag looping in UIScrollView. but 3 imageviews are there, but they have used 9 numberOfPhysicalPages, why should we use 9 cant we use 3 only to page loop? any help?

    Read the article

  • Ensure User has entered string in correct format?

    - by Daniel Granger
    Hi, Whats the best way to ensure the user has entered a valid time string such as: 5:24 5.4 102:30 102.5 It will be entered into a UITextField therefore will be in a NSString. I want to allow the user to enter the time in either hours and minutes (hh:mm) or hours and decimal minutes (hh.m). In the hours minutes example they should be able to enter as many hours as the like but only between 0 - 59 minutes. With the hours decimal minutes I want them to only be able to enter again as many hours as the like but decimal minutes can only be 0 - 9. Many Thanks

    Read the article

  • How to play sound automatically when scrolling to the next page?

    - by viper15
    I'm using Page Control example from Apple. I want to be able to scroll horizontally to certain page and get the sound automatically play when viewing that page? And then sound stop when viewing the other page? So, for example. On page 1, i have some texts. When i go to the next page which is on page 2, i want sound to be automatically play and stop when i go to page 3. I'm planning to use If statements (since it's not that many pages) to determine which page will get the sound. My question is simple. How do you get the sound play automatically when viewing certain page? By the way, I'm planning to use System Sound. I know how to play the sound using button. But how do you get it automatically - start when certain page appear and stop when moving to the next page. Thank you in advance! Edited: I put in this code in ViewDidLoad but the sound played on sooner before it reach the page intended: // Set the label and background color when the view has finished loading. - (void)viewDidLoad { pageNumberLabel.text = [NSString stringWithFormat:@"Page %d", pageNumber + 1]; self.view.backgroundColor = [MyViewController pageControlColorWithIndex:pageNumber]; if (pageNumber == 3) { NSString *path = [[NSBundle mainBundle] pathForResource:@"crunch" ofType:@"wav"]; SystemSoundID soundID; AudioServicesCreateSystemSoundID((CFURLRef)[NSURL fileURLWithPath:path], &soundID); AudioServicesPlaySystemSound(soundID); } }

    Read the article

  • core plot error?

    - by senthilmuthu
    hi, i am using core plot framework,when i run following code in viewdidload gives crash.the view is as custom view... graph = [(CPXYGraph *)[CPXYGraph alloc] initWithFrame:CGRectZero]; CPLayerHostingView *hostingView = (CPLayerHostingView *)self.view; hostingView.hostedLayer = graph;**(gives error)** what i have to do? any help please?

    Read the article

  • Custom Cell over lapping.

    - by user338322
    I am trying to use a custom cell, My custom cell is of size 320*220 pixels. My table size is 320* by 1500 which is large enough I have set custom cell's view in scale to fill mode. But when i fill the table using custom cell all i see is first row. i have total four rows to be filld in a custom way. but they gets overlapped and i can not see any of the table.. They do look, but overlapped, Any hints .. about why its happening Do i need to make changes into nib? -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ static NSString *CellIdentifier = @"CustomCell"; CustomCell *cell = (CustomCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"CustomCell" owner:self options:nil]; for (id oneObject in nib) if ([oneObject isKindOfClass:[CustomCell class]]) cell = (CustomCell *)oneObject; } cell.iconImage.image = [UIImage imageNamed:[NSString stringWithFormat:@"beach%d.jpg",indexPath.row+1]]; cell.title.text=[[RArrray objectAtIndex:indexPath.row] objectForKey:@"Beach"]; return cell; }

    Read the article

  • Help adding a backgroundView to UITableViewCell

    - by Alex
    I'm getting really desperate trying to add a UIImageView to UITableViewCell.backgroundView. All my efforts have resulted in this crappy rendering: It looks like the cell's label's white background is sitting on top of cell's background and covering portions of it. I tried setting the label's background color to clear, or some other color and it does not have any event. It is always white. The reason I know it's the text label's background causing this white area is that if I don't do [cell setText:@"Cell text here"]; the white area is gone and I see just the cell's background image. Here's the code that I'm using. The table view is added in the .xib file and UITableView is added to UIViewController: - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { return 1; } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return [myCollection.items count]; } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { NSUInteger rowIndex = indexPath.row; static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease]; cell.backgroundView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"darkCellBackground.png"]]; cell.selectedBackgroundView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"darkCellBackground.png"]]; } [cell setText:@"Cell text here"]; return cell; } - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { // Navigation logic may go here. Create and push another view controller. // AnotherViewController *anotherViewController = [[AnotherViewController alloc] initWithNibName:@"AnotherView" bundle:nil]; // [self.navigationController pushViewController:anotherViewController]; // [anotherViewController release]; [tableView deselectRowAtIndexPath:indexPath animated:YES]; } - (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath { return NO; } I'm sure I'm doing something wrong but cant quite figure out what.

    Read the article

  • Deleting from 2 arrays of dictionaries

    - by Matt Winters
    I have an array of dictionaries loaded from a plist (below) called arrayHistory. <plist version="1.0"> <array> <dict> <key>item</key> <string>1</string> <key>result</key> <string>8.1</string> <key>date</key> <date>2009-12-15T19:36:59Z</date> </dict> ... </array> </plist> I filter this array based on 'item' so that a second array, arrayHistoryDetail has the same structure as arrayHistory but only contains e.g. 'item's equal to '1'. These detail items are successfully displayed in a tableView. I then want to select an item from the tableView, and delete it from the tableView data source, arrayHistoryDetail (line 2 in the code below) - works, then I want to delete the item from the tableView itself (line 3 in the code below) - also works. My problem is that I also need to delete it from the original arrayHistory, so I tried the following: created a temporary dictionary as an ivar: NSMutableDictionary *tempDict; @property (nonatomic, retain) NSMutableDictionary *tempDict; Then my thinking was to make a copy in line 1 and remove it from the original array in line 4. 1 tempDict = [arrayHistoryDetail objectAtIndex: indexPath.row]; 2 [arrayHistoryDetail removeObjectAtIndex: indexPath.row]; 3 [tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade]; 4 [arrayHistory removeObject:tempDict]; Didn't work. Could someone please guide me in the right direction. I'm thinking that tempDict is a pointer and that removeObject needs a copy? I don't know. Thanks.

    Read the article

  • How to perform a cell deselection when a user returns to a table view?

    - by Panagiotis Korros
    I am using a UITableView to display a list of cells, when the user selects a cell then a new view appears by using the following code: - (void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { [self.navigationController pushViewController: detailsViewController animated: TRUE]; } By using the code above, the view is displayed correctly, but when I return back to the root table view, then the cell is still selected. I noticed, in many sdk examples, that the cell is deselected (with a nice animation) when the root view is poped pack, but I could not find the code that implemented this feature in any of the examples. I know that I can use: [tableView deselectRowAtIndexPath:indexPath animated: YES]; to implement this, but I am very curious on how these examples do it without using any code. Any ideas?

    Read the article

  • Unable to Access UILabel in UITableViewCell

    - by Nirmal
    I am having trouble in accessing which is in the UITableViewCell, that i have placed in my main .xib file. That Label is connected to IBOutlet servicesCell. And the Label inside the table view cell is connected through IBOutlet serviceLabel. At runtime i am not getting the text which i am assining to that label. Following is my sample code for that. static NSString *ServiceIdentifier = @"ServiceIdentifier"; UITableViewCell *cell1 = [tableView dequeueReusableCellWithIdentifier:ServiceIdentifier]; if(cell1 == nil) { [[NSBundle mainBundle] loadNibNamed:@"servicesCell" owner:self options:nil]; cell1 = servicesCell; } // label access serviceLabel = (UILabel *)[cell1 viewWithTag:1]; serviceLabel.numberOfLines = 3; serviceLabel.lineBreakMode = UILineBreakModeWordWrap; [serviceLabel setTextAlignment:UITextAlignmentLeft]; [serviceLabel setText:@"Testing String"]; Anyone have any idea then please help.. Thanks in advance..

    Read the article

  • Only the last node moves when multiple nodes are called for action

    - by Kriem
    Of the three parts I want to move, only the last one actually moves. I can't seem to "recycle" the ease action I created. How is this done the correct way? - init { // initial setup [self moveParts]; } - (void)moveParts { id action = [CCMoveBy actionWithDuration:1 position:ccp(0,160)]; id ease = [CCEaseInOut actionWithAction:action]; [part1 runAction:ease]; [part2 runAction:ease]; [part3 runAction:ease]; }

    Read the article

  • Adding a Image to UITable View Cell

    - by Graeme
    Hi, I have a table in which I want a dynamic image to load in at the left-hand side. The table needs to use an IF statement to select the appropriate image from the "Resources" folder, and needs to be based upon [dog types]. The [dog types] is extracted from an RSS feed, and so the image in the table cell needs to match the each cell's [dog types] tag. I suspect I need to use - (UIImage *)imageForTypes:(NSString *)types { to do such a thing. Thanks.

    Read the article

  • TableView problem with Tab Bar!?!?!

    - by Daniel Granger
    I created a tableView which worked fine in a single view app but as soon as I changed the view controller for a Tab Bar Controller and tapped the tab for the view with the table view in I suddenly get this! What has gone wrong? [Session started at 2010-03-28 15:30:15 +0100.] 2010-03-28 15:30:17.763 LogbookTable[13473:207] *** -[UIViewController tableView:numberOfRowsInSection:]: unrecognized selector sent to instance 0x3b14d10 2010-03-28 15:30:17.765 LogbookTable[13473:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[UIViewController tableView:numberOfRowsInSection:]: unrecognized selector sent to instance 0x3b14d10' 2010-03-28 15:30:17.766 LogbookTable[13473:207] Stack: ( 29303899, 2465178889, 29685819, 29255286, 29107906, 4372518, 4379894, 4378891, 3095430, 3035941, 3077376, 3065931, 55820976, 55820399, 55818438, 55817530, 2739877, 2763572, 2745983, 2773089, 37399897, 29088640, 29084744, 2739733, 2777007, 10496, 10350 )

    Read the article

  • How do I populate an NSMutableArray in one class with another object?

    - by AngeloS
    Hello, I know this is a simple answer, but I can't seem to find the solution. I created an object in its own class and I am trying to populate it with data from another class. For simple data types like NSString, I have no problem, but when trying make an NSMutableArray equal to another NSMutableArray or when I try to populate a NSMutableArray with another objects (like strings), I keep getting exception errors... Here is the object I am trying to populate: #import <Foundation/Foundation.h> @interface RSSFeedList : NSObject { NSString *subject; NSMutableArray *rssfeedDetail; } @property (nonatomic, retain) NSString *subject; @property (nonatomic, retain) NSMutableArray *rssfeedDetail; @end This is how I was able to populate the NSString 'subject' in another class: rssFeedList.subject = @"test"; However, if I follow similar convention within that same class with respect to an Array, it throws an exception: rssFeedList.rssfeedDetail = rssItemDetailArray; Where rssItemDetailArray is a NSMutableArray that I have built in the same class. I have also tried to add items (i tried strings for testing) to the NSMutableArray directly like so to no avail: [rssFeedList.rssfeedDetail addObject:@"test"]; Any ideas?? Thanks in advance!!

    Read the article

  • Having a UITextField in a UITableViewCell

    - by Mathieu
    Hi! I'm trying to do that for a couple of days now, and after reading tons of messages of people trying to do that too, I'm still unable to have a fully working UITextField in some of my UITableViewCells, just like in this example: http://img231.imageshack.us/img231/4858/picture4za3.png Either I have the form working but the text is not visible (although I set its color to blue), the keyboard goes on the field when I click on it and I haven't been able to correctly implement the keyboard events. I tried with a bunch of examples from Apple (mainly UICatalog, where there is a kinda similar control) but it's still not working correctly. Can somebody help me (and all the people trying to realize this control) and post a simple implementation of a UITextField in a UITableViewCell, that works fine? Thank you very much.

    Read the article

  • Image animation over CGContextDrawPDFPage

    - by BittenApple
    I have a pdf page displayed with CGContextDrawPDFPage. I want to keep this page shown and have an image slide in from top over this page, just as it can be seen in the iBooks application. It's a book, the sliding image is a bookmark that slides in when you are about to close the book. What is the best way to go about implementing this?

    Read the article

  • How to format date from string?

    - by 4thSpace
    I have a string with this value: 2010-05-13 23:17:29 I'd like to format it and am using the following code: NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; formatter.dateStyle = NSDateFormatterMediumStyle; NSDate *formattedDate = [formatter dateFromString:dateString]; [formatter release]; When the debugger reaches the release line, formattedDate shows "invalid CFStringRef" and Cannot access memory at address 0x0 Any ideas what I'm doing wrong?

    Read the article

  • About setStatusBarHidden

    - by iTarek
    Today my app approved, but I got emails from users says it crash. I figured out that [[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation: UIStatusBarAnimationSlide]; Is the problem, Because users have firmware 3.1.x this API is not working and app crash. So I have replace it with if ([[[UIDevice currentDevice] systemVersion] floatValue]>=3.2) [[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation: UIStatusBarAnimationSlide]; else [[UIApplication sharedApplication] setStatusBarHidden:YES animated:YES]; My questions... Is what I did the best solution? Why XCODE did not warn me that SetStatusBarHidden withAnimation is not in 3.0 while I set my Traget OS firmware 3.0? Do I have to check on every API to see if it is working with my Target OS? Thank you

    Read the article

  • identifying Button selection of each row in Tableview?

    - by senthilmuthu
    hi,i coded like - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { UIButton *btn = [UIButton buttonWithType:UIButtonTypeRoundedRect]; btn.frame = CGRectMake(230.0f, 4.0f, 60.0f, 36.0f); [btn setTitle:@"OK" forState:UIControlStateNormal]; [btn setTitle:@"OK" forState:UIControlStateSelected]; [btn addTarget:self action:@selector(onClickRename:) forControlEvents:UIControlEventTouchUpInside]; [cell addSubview:btn]; return cell; } but if the user selects the button on particular row, i can change that image through onClickRename...but can i get inwhich row's image has been touched through (void)tableView:(UITableView )tableView didSelectRowAtIndexPath:(NSIndexPath)indexPath ?

    Read the article

  • How to get the location (x,y) of a CCLabel that is a child of a CCScene?

    - by RexOnRoids
    (learning Cocos2D) After creating a CCLabel and adding it to a CCLayer like this: //From HelloWorldScene.m // create and initialize a Label CCLabel* label1 = [CCLabel labelWithString:@"Hello" fontName:@"Marker Felt" fontSize:10]; label1.position = ccp(35, 435); // add the label as a child to this Layer [self addChild: label1]; How do I determine when a user has TOUCHED the label on the screen?

    Read the article

< Previous Page | 158 159 160 161 162 163 164 165 166 167 168 169  | Next Page >