Search Results

Search found 15682 results on 628 pages for 'iphone'.

Page 140/628 | < Previous Page | 136 137 138 139 140 141 142 143 144 145 146 147  | Next Page >

  • Cannot show scene with Cocos2D when using UITabBarController

    - by gw1921
    Hi I'm new to Cocos2D but am having serious issues when trying to load a cocos scene in one of the UIViewControllers mixed with other normal UIKit UIViewControllers. My project uses a UITabBarController to manage four view controllers. Three are normal UIKit view controllers while one of them I want to use cocos2D for (to draw some sprites and animate them). The following is what I've done so far. In the applicationDidFinishLaunching method, I initialize cocos2D to use the window and take the first tabbarcontroller view: - (void)applicationDidFinishLaunching:(UIApplication *)application { if( ! [CCDirector setDirectorType:CCDirectorTypeDisplayLink] ) { [CCDirector setDirectorType:CCDirectorTypeDefault]; } [[CCDirector sharedDirector] setPixelFormat:kPixelFormatRGBA8888]; [CCTexture2D setDefaultAlphaPixelFormat:kTexture2DPixelFormat_RGBA8888]; [[CCDirector sharedDirector] setDisplayFPS:YES]; [[CCDirector sharedDirector] attachInView: window]; [[[CCDirector sharedDirector] openGLView] addSubview: tabBarController.view]; [window makeKeyAndVisible]; } Then in the third UIViewController code (where I want to use cocos2D) I do this (note: the view is being loaded from a NIB file which has a blank UIView and nothing else):\ - (void)viewDidLoad { [super viewDidLoad]; // 'scene' is an autorelease object. CCScene *myScene = [CCScene node]; // 'layer' is an autorelease object. MyLayer *myLayer = [MyLayer node]; // add layer as a child to scene [myScene addChild: myLayer]; [[CCDirector sharedDirector] runWithScene: myScene]; } However all I see is a blank white view and nothing else. If I call the following in viewdidLoad: [[CCDirector sharedDirector] attachInView: self.view]; The app crashes complaining that CCDirector is already attached. Please help!

    Read the article

  • How do you tell what object is being touched in touchesBegan?

    - by Flafla2
    I know that this is a very commonly asked question, but all of the answers on every website don't work! If you still don't know what I mean, then maybe this line of code will help you understand. - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { UITouch *touch = [[event allTouches] anyObject]; CGPoint location = [touch locationInView:self.view]; if (touch.view == nextbutton) [self performSelector:@selector(next)]; if (touch.view == prevbutton) [self performSelector:@selector(previous)]; if (touch.view == moreoptionsbutton) [self performSelector:@selector(moresettings)]; } It doesn't do anything when you touch nextbutton, prevbutton, and more optionsbutton, which are UIImageViews by the way. I have also tried using isEqual: instead of ==, but that hasn't worked out either. Any suggestions?

    Read the article

  • iPad/iPod: autoRotate resizes view in window

    - by Jasconius
    Developing an iPad interface, I have a scenario where I have a UIViewController which manages a view that gets placed directly as a subview of the main UIWindow. Before being placed in the UIWindow, that view gets resized to a non-standard size, let's say, 768x460, and positioned at the bottom of the screen. When rotating the device, the autoRotate feature of the UIViewController causes the view to be resized so that it fills the entire UIWindow space. I thought this might be because in the XIB, the view is set to window size, but when I changed it to reflect the desired size, it still expanded it to the window size. Then I went into the MainWindow XIB and turned off autoresizeSubviews, and it still happens. This is a very frustrating problem, I am hoping that there is merely something obvious that I am missing out on. Anyone have any bright ideas?

    Read the article

  • Adding a dynamic 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. Update: See code below for what I'm looking to do (only below it's for earthquakes, for me its pictures of dogs). I suspect I need to use - (UIImage *)imageForTypes:(NSString *)types { to do such a thing. Thanks. Updated code: This is for Apple's Earthquake sample but does exactly what I need to do. It matches images to the severity (2.0, 3.0, 4.0, 5.0 etc.) of every earthquake to the magnitude. - (UIImage *)imageForMagnitude:(CGFloat)magnitude { if (magnitude >= 5.0) { return [UIImage imageNamed:@"5.0.png"]; } if (magnitude >= 4.0) { return [UIImage imageNamed:@"4.0.png"]; } if (magnitude >= 3.0) { return [UIImage imageNamed:@"3.0.png"]; } if (magnitude >= 2.0) { return [UIImage imageNamed:@"2.0.png"]; } return nil; } and under - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath magnitudeImage.image = [self imageForMagnitude:earthquake.magnitude];

    Read the article

  • TableVIew scrolling vertically

    - by senthilmuthu
    hi, i i want to activate scrolling vertically through programming for 2 UITableview at sametime?(one table view length 160,another one has 160).is it possible ?In one Viewcontroller's view i have scrollview, on that i have two tableviews(instead of one,like two column)..how can i scroll vertically both at same time?any help please?

    Read the article

  • [three20] dynamically add Items to TTLauncher

    - by choise
    Hi guys, in my app i got a TTLauncher Object with some TTLauncherItems in it. Now i want to add some Items dynamically inside my App by pressing a button. Is there a simple way to do that or do i have to create my own methods? In the original facebook application there is already something like that implemented. (You can add your Friends to the Launcher) If not, what would be the best thing to do something like that? Store all "extra items" in a plist oder even in a database and query them, each time TTLauncher object is initialized? Thanks for help :)

    Read the article

  • How to add a custom background to UISearchDisplayController's table view?

    - by Boon
    I want to add a custom UIImageView to UISearchDisplayController's table view background and set table view's background color to clearColor. Tried a few different approach but couldn't find the right solution. Any idea how to approach this? Note: I don't want to add to searchDisplayController's searchResultsTableView's view hierarchy, but rather overlay another sibling view below it)

    Read the article

  • OpenGl es view and uitableview

    - by Mel
    I have written an application using opengl es view. Now I want to add a uitableview to display on the screen. However I am needing some guidance on how opengl es view and the other views play together nice. For example I have read some things that would lead me to think I need to pause the opengl view when the table is displayed. Can anyone point me to a tutorial on how to make these things work together or just point me to the stackoverflow question that I can't find where some guy asked the same exact thing and got an answer :-)

    Read the article

  • loading and formating the rtf file in uiwebview

    - by Jayshree
    Hello everybody. I am trying to load the contents of a rtf file in the uiwebview. I am successful in loading the contents, but it is unformatted. the fonts are too large and it doesnt have any format. it displays the color of the rtf content, but not the font or size. So what should i do now. is there anyother way to load the rtf and format it???? I load the rtf in following way: NSString *path = [[NSBundle mainBundle] pathForResource:@"Home" ofType:@"rtf"]; NSURL *url=[NSURL fileURLWithPath:path]; NSURLRequest *req=[NSURLRequest requestWithURL:url]; [menuWeb loadRequest:req]; So what should i do now. can anybody help me????

    Read the article

  • NSSet to NSData, then back out again, for GameKit?

    - by Peter Hajas
    Hi guys, I'm trying to do some image edit syncing between two of the same app running on different iPhones. I would like to send an NSSet * from one device to another (which I imagine involves encapsulating in NSData) then decrypting this back to an NSSet, then using it in a touchesMoved type of function. Is this feasible, or should I work on syncing the UIImages instead? I worry that UIImage syncing would have too much latency for realtime interaction. Thanks for your help!

    Read the article

  • Three20 - add items to launcherView after viewDidLoad

    - by lostInTransit
    Hi I am getting a list of image URLs and corresponding names at run time in my app. I would like to add these images to a TTLauncherView object that I have. Cannot add these in loadView. I am making a call to the method for getting my data in a separate thread. Once the thread completes, I add the TTLauncherItem objects to an array and set the "pages" variable of the LauncherView. But for some reason, the view is not updated and I don't see anything on it. Can someone please let me know how to refresh the launcherview after adding items to it in methods other than loadView? Thanks.

    Read the article

  • Why not use development provisioning instead of ad hoc?

    - by lawrence
    I was under the impression that when you use a development provisioning profile for a build of an app, only the specified developers can deploy that build to a phone. But I just deployed a build that uses a development profile to a phone using Xcode Organizer, even though I'm not one of the valid developers for that profile. One of my colleagues, also not a valid developer, did the same with his phone using iTunes. In that case, why not use a development provisioning profile for distributing your app to e.g. your QA team, instead of ad hoc distribution?

    Read the article

  • TextField focus on UIAlertView

    - by Nyxem
    Hello, I have a subclass of UIAlertView with 2 UITextField for login / password. My problem is that when I have finished to type my login and change the focus to the password field, there is a cursor on the login field and on the password field, but the focus is on the password field, so my question is, how can I make the cursor disappear on the login field ? Thanks for your help.

    Read the article

  • How to auto-scroll UITableView?

    - by Sheehan Alam
    I am trying to do something interesting. I am pulling some JSON data and populating cells in a UITableView. How can I make the UITableView scroll ever second or so? I want to give the effect that as new data is coming in, the table is scrolling, so it is streaming. Any ideas?

    Read the article

  • How to create a bundle

    - by flohei
    Hi there, how do I create a bundle with resources like images and xibs to share it between apps? I saw that there's a way to do it when creating a new project, but there must be a way to do it based on a finished project, right? Thanks in advance –f

    Read the article

  • Adding a UINavigationController to a UITabBarController

    - by Andy Jacobs
    I have a set of 10 navigationViewControllers i want to the UITabBarController this all just works fine except the fact when i want to see a UINavigationController that is in the "more" tab it doesn't switch to it. it does nothing. if i change that to a UIViewController it just works fine .. ok in the more tab you automatically have a UINavigationController to you disposal but if the user switches the tab's order and its not anymore in the "more" tab you don't have a UINavigationController .. any tips ?

    Read the article

  • Why in landscape orientation in simulator all the subviews appear out of order?

    - by wolverine
    I was doing a sample app in ipad. I added about 4 to 5 imageviews to the left side of the view vertically. This view will appear when we select the corresponding entry in the splitviewcontroller. In ipad simulator too, all the images were loading and all are working fine in portrait orientation. But when I rotate the simulator to landscape orientation, these imageviews doesnt appear where i placed them. Some of them overlapping each other, some have half of their part in the navigation bar and all. Has gone completely out of order. I am confused why is all this happening. Can anyone help me solve this issue?

    Read the article

  • Problem with playing a sound when a button is clicked.

    - by iSharreth
    in my code: import "MyViewController.h" import (IBAction)playSound{ AVAudioPlayer *myExampleSound; NSString *myExamplePath = [[NSBundle mainBundle] pathForResource:@"myaudiofile" ofType:@"caf"]; myExampleSound =[[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:myExamplePath] error:NULL]; myExampleSound.delegate = self; [myExampleSound play]; } But it is showing a warning that Class MyViewController does not implement AVAudioplayerDelegate. Anyone please help. I had included the AVFoundation.Framework.

    Read the article

  • Adding picture in pickerview

    - by iSharreth
    UIImageView *one = [[UIImageView alloc]initWithImage:[[UIImage alloc] initWithContentsOfFile:[[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"ball1.png"]]] ; UIImageView *two = [[UIImageView alloc]initWithImage:[[UIImage alloc] initWithContentsOfFile:[[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"ball2.png"]]] ; UIImageView *three = [[UIImageView alloc]initWithImage:[[UIImage alloc] initWithContentsOfFile:[[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"ball3.png"]]] ; arrayBalls = [[NSArray alloc]initWithObjects:one,two,three,nil]; I used the above code for displaying image in the pickerview. But the application is crashing when executing this code. Anyone please help.

    Read the article

  • how to increase the precision in Locate Me app

    - by thndrkiss
    Hi, I just installed the locate me app and started to understand the CLLocation stuff. I need to know how to increase the number of digits after the lat and long numbers displayed. Can any one help me. currently it shows 17.5968,82.8486. I need more number of digits after decimal(6 digits after decimal.

    Read the article

  • Loading animation Memory leak

    - by Ayaz Alavi
    Hi, I have written network class that is managing all network calls for my application. There are two methods showLoadingAnimationView and hideLoadingAnimationView that will show UIActivityIndicatorView in a view over my current viewcontroller with fade background. I am getting memory leaks somewhere on these two methods. Here is the code -(void)showLoadingAnimationView { textmeAppDelegate *textme = (textmeAppDelegate *)[[UIApplication sharedApplication] delegate]; [[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:YES]; if(wrapperLoading != nil) { [wrapperLoading release]; } wrapperLoading = [[UIView alloc] initWithFrame:CGRectMake(0.0, 0.0, 320.0, 480.0)]; wrapperLoading.backgroundColor = [UIColor clearColor]; wrapperLoading.alpha = 0.8; UIView *_loadingBG = [[UIView alloc] initWithFrame:CGRectMake(0.0, 0.0, 320.0, 480.0)]; _loadingBG.backgroundColor = [UIColor blackColor]; _loadingBG.alpha = 0.4; circlingWheel = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge]; CGRect wheelFrame = circlingWheel.frame; circlingWheel.frame = CGRectMake(((320.0 - wheelFrame.size.width) / 2.0), ((480.0 - wheelFrame.size.height) / 2.0), wheelFrame.size.width, wheelFrame.size.height); [wrapperLoading addSubview:_loadingBG]; [wrapperLoading addSubview:circlingWheel]; [circlingWheel startAnimating]; [textme.window addSubview:wrapperLoading]; [_loadingBG release]; [circlingWheel release]; } -(void)hideLoadingAnimationView { [[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:NO]; wrapperLoading.alpha = 0.0; [self.wrapperLoading removeFromSuperview]; //[NSTimer scheduledTimerWithTimeInterval:0.8 target:wrapperLoading selector:@selector(removeFromSuperview) userInfo:nil repeats:NO]; } Here is how I am calling these two methods [NSThread detachNewThreadSelector:@selector(showLoadingAnimationView) toTarget:self withObject:nil]; and then somewhere later in the code i am using following function call to hide animation. [self hideLoadingAnimationView]; I am getting memory leaks when I call showLoadingAnimationView function. Anything wrong in the code or is there any better technique to show loading animation when we do network calls?

    Read the article

  • Make circular joystick

    - by Jaba
    How do I make a joystick like the one in i dig it, using UIImageView's that the smaller one can be used to move around, I just really would like to know how I would get the smaller UIImageView to stay inside the larger one, I just don't know how I would do this because they are both circular. I have an Image below:

    Read the article

  • How to save video from a url to disk, also how to begin playback after some buffering?

    - by Shizam
    First question is, given a url to an mp4 video, how can I save that file to disk? The followup to that is while its saving, can I begin playback after its buffered some of the video to disk or do I have to wait for the entire file to be written and then: MPMoviePlayerController* theMovie=[[MPMoviePlayerController alloc] initWithContentURL:theURL]; using the path to the local file. Thanks, Sam

    Read the article

  • How to save video from a url to disk, also how to begin playback after some buffering?

    - by Shizam
    First question is, given a url to an mp4 video, how can I save that file to disk? The followup to that is while its saving, can I begin playback after its buffered some of the video to disk or do I have to wait for the entire file to be written and then: MPMoviePlayerController* theMovie=[[MPMoviePlayerController alloc] initWithContentURL:theURL]; using the path to the local file. Thanks, Sam

    Read the article

  • Core Data ANY BETWEEN predicate

    - by Mike Weller
    I'm trying to create an NSPredicate to find 'projects' that contain 'sessions' within a certain date range. I tried this at first: [NSPredicate predicateWithFormat:@"ANY sessions.date BETWEEN {$STARTDATE, $ENDDATE}"]; But I get an exception: *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'to-many key not allowed here' It seems BETWEEN does not work with ANY in this way. I'm also limited in use of () and AND clauses meaning I can't use something like: [NSPredicate predicateWithFormat:@"ANY (sessions.date > $STARTDATE && sessions.date < $ENDDATE)"]; If I try that I get a parse error. How can I do this? Thanks UPDATE: Note that this: [NSPredicate predicateWithFormat:@"ANY sessions.date > $STARTDATE && ANY sessions.date < $ENDDATE"]; Is incorrect because it returns a project where there is a session greater than the start date and another session less than the end date but no session in between.

    Read the article

< Previous Page | 136 137 138 139 140 141 142 143 144 145 146 147  | Next Page >