Search Results

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

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

  • How to reuse actions

    - 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

  • Core Data - Best way to save a "number of items"

    - by Daniel Granger
    The user will have a static list of items to choose from. Using a Picker View they will choose one of the items and then select how many of them they want. Whats the best way to save this in core data? A Struct? struct order { NSInteger item; NSInteger numberOf; }; Or some sort of relationship? Many Thanks

    Read the article

  • Cannot change UIImageView frame in a custom table cell.

    - by jkally
    I have a custom table cell. In it I have put (via the IB) an image view of a certain frame In 'cellForRowAtIndexPath', under certain conditions, I would like to modify the frame of this UIImageView, so I write something like: UIImageView *imgv = (UIImageView *)[cell viewWithTag:1]; CGRect r = CGRectMake(20.0, 20.0, 10.0, 10.0); imgv.frame = r; But nothing expected happens (The frame does move a little though not to where I want, but doesn't change its size at all);

    Read the article

  • How can I set different sound for different players by using [[SimpleAudioEngine sharedEngine] playE

    - by srikanth rongali
    I need to set sounds for different players in my game. There are 10 players. And I have 10 sounds. The players are loaded int his way for( int i = 1; i <5; i++ ) { [playerAnimation addFrameWithFilename: [NSString stringWithFormat:@"Player %02d gun draw_%02d.png", playerNumber, i]]; } How can I set the sounds in this way by giving the filenames. And player1 shoots player1sound should play. How can I do it using [[SimpleAudioEngine sharedEngine] playEffect:@"player1.sound.wav"];

    Read the article

  • ipod app replacement-in-a-tab?

    - by Frank C
    With the new media-library capabilities in the 3.0 SDK, I'd like to have a tab in my application to control the music that's playing. Not just pause and play (i'm aware that pressing the home button twice brings up controls for this), but also the ability to browse and queue albums/artists/songs/playlists. Basically a copy of the ipod app functionality. Any chance someone has already done this and made it freely available?

    Read the article

  • CADisplayLink stops updating when UIScrollView scrolled

    - by Tricky
    Title is quite self explanatory, but I have some animation being done in a loop triggered by CADisplayLink. However, as soon as I scroll a UIScrollView I have added to my view hierarchy, the animation stops immediately, only to return again when scrolling has completely stopped and come to a standstill.... Anyway to cancel this behaviour?

    Read the article

  • buttons and menu items in cocos2d/objective-c

    - by peter61
    In my app, I'd like a method called whenever the user taps the screen (anywhere on the screen). Normally, I'd make a transparent UIButton that covers the whole screen. If I'm using the cocos2d framework, what's the best way to do this? Is it good practice to still use UIButtons? I've been reading about MenuItems but haven't found an easy way to make one giant fully transparent menu item? Thanks.

    Read the article

  • Setting UITableViewCell height is expensive

    - by Sheehan Alam
    I am doing a comparison in - (CGFloat)tableView:(UITableView *)tblView heightForRowAtIndexPath:(NSIndexPath *)indexPath It seems like performance of my app really slows down when I check if a cell.detailTextLabel.text isEqualTo:@"None"; What is a better way of doing the comparison and setting the cell height?

    Read the article

  • UIRemoveNotificationType invalid conversion

    - by Daniel Wood
    Hi, I'm trying to use this fairly standard line of code in my app: [[UIApplication sharedApplication] registerForRemoteNotificationTypes:(UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound)]; But am receiving the follow error: error: invalid conversion from 'int' to 'UIRemoteNotificationType' It works if I only use one of the notification types but fails every time if I try and use more than one. Any ideas what I'm doing wrong?

    Read the article

  • Optimal way to initialize varying objects

    - by John Smith
    I have to initialize a lot of different types of objects based on an integer parameter. They all have the same overall initialization methods. At the moment I have the following code #def APPLE 1 #def PEAR 2 switch (t) { case APPLE: newobj = [[FApple alloc] init]; break; case PEAR: newobj = [[FPear] alloc] init]; break; default: retobj = nil; } I believe there must be a better way to do this. When I add FOrange I have to go and add another line here. What would be a better way?

    Read the article

  • loading record into detailview

    - by summer
    please please i need help..i think i am lost somewhere..basically i followed the example http://www.iphonesdkarticles.com/2008/10/sqlite-tutorial-loading-data-as.html, but i was stuck with error on reading description..something must had gone wrong some well but i am not very sure how should i solve it. this is my code, actually i dun really have an idea on wat's really going in this code..help please..2days!! no solution!! - (void) hydrateDetailViewData { //if detail view is hydrated then do not get it from database if(isDetailViewHydrated) return; if(detailStmt == nil) { const char *sql = "select snapTitle, snapDesc from Snap where snapID =?"; if(sqlite3_prepare_v2(database, sql, -1, &detailStmt, NULL) != SQLITE_OK) NSAssert1(0, @"Error while creating detail view statement. '%s'", sqlite3_errmsg(database)); NSLog(@"SQLite= %d", sqlite3_step(detailStmt)); } if(SQLITE_DONE != sqlite3_step(detailStmt)) { // NSString *descStr = [[NSString alloc] //initWithString:sqlite3_column_text(detailStmt, 2)]; NSString *descStr = [NSString stringWithUTF8String:(char *)sqlite3_column_text(detailStmt,2)]; self.snapDescription = descStr; [descStr release]; } else NSAssert1(0, @"Error getting description of snap2play. '%s'", sqlite3_errmsg(database)); sqlite3_reset(detailStmt); isDetailViewHydrated = YES; //if hydrated, make sure do not get from database again. } }

    Read the article

  • The delegate method "clickedButtonAtIndex:" is not called.

    - by sagiftw
    Hello everyone! I have created an alert view with two buttons using the following code: UIAlertView *alertView = [[UIAlertView alloc] initWithTitle: title message: msg delegate:nil cancelButtonTitle:@"Replay" otherButtonTitles:@"Highscore", nil]; [alertView show]; I want to run some code when one of the buttons is clicked. In order to do so, I have added the following method to the delegate.m file: - (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex { if (buttonIndex==0) //Run some code else //Other code } But this method is not called when I press either of the buttons! Can someone tell me why? Thanks in advance, Sagiftw

    Read the article

  • how to slove error when using thread?

    - by ChandreshKanetiya
    I have following error msg in console when using NSThread "Tried to obtain the web lock from a thread other than the main thread or the web thread. This may be a result of calling to UIKit from a secondary thread. Crashing now..." I have submit my sample code here - (void)viewDidLoad { appDeleg = (NewAshley_MedisonAppDelegate *)[[UIApplication sharedApplication] delegate]; [[self tblView1] setRowHeight:80.0]; [super viewDidLoad]; self.title = @"Under Ground"; [UIApplication sharedApplication].networkActivityIndicatorVisible = YES; [NSThread detachNewThreadSelector:@selector(CallParser) toTarget:self withObject:nil]; } -(void)CallParser { Parsing *parsing = [[Parsing alloc] init]; [parsing DownloadAndParseUnderground]; [parsing release]; [self Update_View]; //[myIndicator stopAnimating]; [UIApplication sharedApplication].networkActivityIndicatorVisible = NO; } here "DownloadAndParseUnderground" is the method of downloding data from the rss feed and -(void) Update_View{ [self.tblView1 reloadData]; } when Update_View method is called the tableView reload Data and in the cellForRowAtIndexPath create error and not display custom cell - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; CustomTableviewCell *cell = (CustomTableviewCell *) [tblView1 dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { [[NSBundle mainBundle] loadNibNamed:@"customCell" owner:self options:nil]; cell = objCustCell; objCustCell = nil; }

    Read the article

  • UINavigationController's back button disappears?

    - by QAD
    I notice something strange happens to one of my view controller: the back button disappears, yet it's possible to go back to previous view controller by tapping the top left corner (i.e where the button should reside). In my entire file there's no line that set self.navigationItem.hidesBackButton to YES; also NSLog prints 0 as self.navigationItem.hidesBackButton's value in viewDidLoad. This occurs in both the simulator and real device. Any ideas?

    Read the article

  • Use of viewDidUnoad

    - by user338111
    What is the use of viewDidUnload and didReceiveMemoryWarning methods? When they actually get called? what are the difference between dealloc, viewDidUnload and didrecievedmemorywarning?

    Read the article

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