Search Results

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

Page 154/628 | < Previous Page | 150 151 152 153 154 155 156 157 158 159 160 161  | Next Page >

  • Where do I attach the StoreKit delegate and observer in a Cocos2d App?

    - by Jeff B
    I have figured out how all of the StoreKit stuff works and have actually tested working code... however, I have a problem. I made my "store" layer/scene the SKProductsRequestDelegate. Is this the correct thing to do? I get the initial product info like so: SKProductsRequest *productRequest = [[SKProductsRequest alloc] initWithProductIdentifiers: productIDs]; [productRequest setDelegate: self]; [productRequest start]; The problem is that if I transition to a new scene when a request is in progress, the current layer is retained by the productRequest. This means that touches on my new scene/layer are handled by both the new layer and the old layer. I could cancel the productRequest when leaving the scene, but: I do not know if it is in progress at that point. I cannot release it because it may or may not have been released by the request delegates. There has got to be a better way to do this. I could make the delegate a class external to the current layer, but then I do not know how to easily update the layer with the product information when the handler is called.

    Read the article

  • Customize Annotation problem....Plz Help.. !!

    - by user128647
    I want to show my custom UIView(.Xib View) to appear when user tabbed on pins (not apple's callOutBubble) and in that UIView there should be a button which fires an IBAction on touched down event. Therefore i have added an AddObserver method to MKAnnotationView. which responds to touch events over pin in MKMapView. But i have also added 3 buttons over that XIB view, which have also assined IBActions. But when i run application, Buttons in Customized Annotation view are not responding to IBAction (Touch Down)? Why this happens ?? What is the solution for that??? I need to have called some method, when those 3 buttons tabbed. Thanks

    Read the article

  • NSString stringWithFormat question

    - by John Smith
    I am trying to build a small table using NSString. I cannot seem to format the strings properly. Here is what I have [NSString stringWithFormat:@"%8@: %.6f",e,v] where e is an NSString from somewhere else, and v is a float. What I want is output something like this: Grapes: 20.3 Pomegranates: 2.5 Oranges: 15.1 What I get is Grapes:20.3 Pomegranates:2.5 Oranges:15.1 How can I fix my format to do something like this?

    Read the article

  • App Crashes Loading View Controllers

    - by golfromeo
    I have the following code in my AppDelegate.h file: @class mainViewController; @class AboutViewController; @interface iSearchAppDelegate : NSObject <UIApplicationDelegate> { UIWindow *window; mainViewController *viewController; AboutViewController *aboutController; UINavigationController *nav; } @property (nonatomic, retain) IBOutlet UIWindow *window; @property (nonatomic, retain) IBOutlet mainViewController *viewController; @property (nonatomic, retain) IBOutlet AboutViewController *aboutController; @property (nonatomic, retain) IBOutlet UINavigationController *nav; [...IBActions declared here...] @end Then, in my .m file: @implementation iSearchAppDelegate @synthesize window; @synthesize viewController, aboutController, settingsData, nav, engines; (void)applicationDidFinishLaunching:(UIApplication *)application { [window addSubview:nav.view]; [window addSubview:aboutController.view]; [window addSubview:viewController.view]; [window makeKeyAndVisible]; } -(IBAction)switchToHome{ [window bringSubviewToFront:viewController.view]; } -(IBAction)switchToSettings{ [window bringSubviewToFront:nav.view]; } -(IBAction)switchToAbout{ [window bringSubviewToFront:aboutController.view]; } - (void)dealloc { [viewController release]; [aboutController release]; [nav release]; [window release]; [super dealloc]; } @end Somehow, when I run the app, the main view presents itself fine... however, when I try to execute the actions to switch views, the app crashes with an EXC_BAD_ACCESS. Thanks for any help in advance.

    Read the article

  • What is wrong with this code?

    - by Horatiu Paraschiv
    @protocol MyViewDelegate <NSObject> - (void) didFinishProcessing:(MyView*)myView; //compiler stops here with error @end @interface MyView : MySuperclass { id<MyViewDelegate> _delegate; } @property (nonatomic, retain) id<MyViewDelegate> delegate; @end When I try to compile I get " expected ')' before MyView ". Where is the error?

    Read the article

  • How to change format of date/time?

    - by 4thSpace
    I have this date and time format: 2010-05-19 07:53:30 and would like to change it to: Wednesday @ 7:53PM 5/19/2010 I'm doing this, which gets the current format: NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; formatter.dateFormat = @"yyyy-MM-dd HH:mm:ss"; but when I change the format, I end up with a null. For example: formatter.dateFormat = @"hh:mm tt MM-dd-yyyy"; date = [formatter stringFromDate:formattedDate]; date will be null. I want to put the end result into an NSString. It would be nice if time and date could come out as separate properties so I can arrange them however I like. Any ideas on how I can change the formatting?

    Read the article

  • insane transformations of a view

    - by Mike
    I have this view and I do some rotation transformation to it using something like myView.transform = CGAffineTransformMakeRotation(degreesToRadian(90)); //The view was originally at angle 0. at some other point of my code, I would like to scale the view animating it, so I do [UIView beginAnimations:nil context:NULL]; [UIView setAnimationDuration:1.0]; myViews.transform = CGAffineTransformMakeScale(2.0f, 2.0f); [UIView commitAnimations]; but when I do that the animation is performed as the view is at 0 degrees, ignoring the previous transformation. It simply assumes as the view is yet at zero degrees, so, this animation scales the view and rotates it back to 0 degrees (!!!!?????) Is this some bug or am I missing something? thanks.

    Read the article

  • UITableViewCell checkmarks

    - by burki
    Hi! When you select a cell in the UITableView, the - (void)tableView:(UITableView *)table didSelectRowAtIndexPath:(NSIndexPath *)indexPath is called. There some of the NSManagedObjects will be updated with the right values and the row will be deselected. Well, it works all right, but you can't see any selection of the tableviewcell. I found out that the access on core data causes the problem, that means, if i comment out the lines with the commands of updating the NSManagedObjects, it all works like I want, with a smooth selection and deselection. Can anybody help? Thanks. - (void)tableView:(UITableView *)table didSelectRowAtIndexPath:(NSIndexPath *)indexPath { //[table deselectRowAtIndexPath:indexPath animated:YES]; NSMutableSet *favoriteGroups = [NSMutableSet setWithSet:element.favoriteGroup]; NSMutableSet *elements = [NSMutableSet setWithSet:[(FavoriteGroup *)[fetchedResultsController objectAtIndexPath:indexPath] element]]; UITableViewCell *checkedCell = [table cellForRowAtIndexPath:indexPath]; if (checkedCell.accessoryType == UITableViewCellAccessoryCheckmark) { [elements removeObject:element]; [favoriteGroups removeObject:[fetchedResultsController objectAtIndexPath:indexPath]]; [[table cellForRowAtIndexPath:indexPath] setAccessoryType:UITableViewCellAccessoryNone]; } else { [elements addObject:element]; [favoriteGroups addObject:[fetchedResultsController objectAtIndexPath:indexPath]]; [[table cellForRowAtIndexPath:indexPath] setAccessoryType:UITableViewCellAccessoryCheckmark]; } element.favoriteGroup = favoriteGroups; FavoriteGroup *favoriteGroup = [self.fetchedResultsController objectAtIndexPath:indexPath]; favoriteGroup.element = elements; [self.tableView deselectRowAtIndexPath:indexPath animated:YES]; }

    Read the article

  • UIView Horizontal scroll for a part of a screen

    - by Futur
    Hi Friends, I have a requirement for scrolling a part of a view horizontally. there are 2 views, mainView(0,70,320*2,400) and a horizontalView(0,0,320*2,160)[this horizontalView has an internal UIScrollView with the same frame] So the horizontal view will occupy the first section of the screen and it should only be scrollable horizontally (and the other part of the mainView - the other part of the screen should be static). how to achieve this? i am getting a general scroll for the whole page not for the first section alone. am i in the right direction for this problem? please advice Thank you

    Read the article

  • Exception if there is IBOutlet in view controller created by initWithNibName

    - by Kail
    When I create a Navigation-based application, the second view controller is created with initWithNibName, if I add a label onto the second view and connect it with IBOutlet in the second view controller. After I navigate to the second view by clicking table cell, and then back to the root view, the application aborts - send message retainCount to a freed object. I know this is caused by the IBOutlet label, which is retained, set nil in viewDidUnload and dealloc in dealloc. But I don't know why, and if I wanna still use IBOutlet, what can I do? Not dealloc it in viewcontroller's dealloc? Anybody could help? Thank you.

    Read the article

  • UITableView loading before variables being set

    - by Sheehan Alam
    I have a label on a UITableView. When clicked it will refresh my tableview and set the top cell's height. When I am setting the cell height, I am checking if a certain variable is TRUE. If true it will show the large height, if false, the smaller height. At the time of cell height creation, my variable is always false. It is a member variable and its value is being set when the user clicks on the label. How can I make sure that the variable is set before the table refreshes?

    Read the article

  • How can I dynamically hide a button from a view?

    - by jpm
    I would like to dynamically hide a button in one of my views, depending on a certain condition. I tried adding some code to the view controller's -viewWillAppear method, to make the button hidden before displaying the actual view, but I still don't know how to do that. I have a reference to the button through an IBOutlet, but I'm not sure how to move forward from here. For reference, this is a UIBarButtonItem instance.

    Read the article

  • Add subview to another view

    - by Martol1ni
    With two ViewControllers, MyView 1 and MyView 2, is there possible to add a subview to MyView2 from MyView1.m? I have tried: MyView2 * screen = [[MyView2 alloc]initWithNibName:nil bundle:nil]; [screen.view addSubView:mySubView]; But my new instance of MyView 2 has no connection to the 'visible' ViewController on MyView2, right? To clarify, the ViewController that is showing, is MyView1. I want MyView1 to be able to add a subview to the MyView2 view. Thanks

    Read the article

  • Debugging a basic OpenGL texture fail? (iphone)

    - by Ben
    Hey all, I have a very basic texture map problem in GL on iPhone, and I'm wondering what strategies there are for debugging this kind of thing. (Frankly, just staring at state machine calls and wondering if any of them is wrong or misordered is no way to live-- are there tools for this?) I have a 512x512 PNG file that I'm loading up from disk (not specially packed), creating a CGBitmapContext, then calling CGContextDrawImage to get bytes out of it. (This code is essentially stolen from an Apple sample.) I'm trying to map the texture to a "quad", with code that looks essentially like this-- all flat 2D stuff, nothing fancy: glEnable(GL_TEXTURE_2D); glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glEnableClientState(GL_TEXTURE_COORD_ARRAY); GLfloat vertices[8] = { viewRect.origin.x, viewRect.size.height, viewRect.origin.x, viewRect.origin.y, viewRect.size.width, viewRect.origin.y, viewRect.size.width, viewRect.size.height }; GLfloat texCoords[8] = { 0, 1.0, 0, 0, 1.0, 0, 1.0, 1.0 }; glBindTexture(GL_TEXTURE_2D, myTextureRef); // This was previously bound to glVertexPointer(2, GL_FLOAT , 0, vertices); glTexCoordPointer(2, GL_FLOAT, 0, texCoords); glDrawArrays(GL_TRIANGLE_FAN, 0, 4); glDisableClientState(GL_TEXTURE_COORD_ARRAY); glDisable(GL_TEXTURE_2D); My supposedly textured area comes out just black. I see no debug output from the CG calls to set up the texture. glGetError reports nothing. If I simplify this code block to just draw the verts, but set up a pure color, the quad area lights up exactly as expected. If I clear the whole context immediately beforehand to red, I don't see the red-- which means something is being rendered there, but not the contents of my PNG. What could I be doing wrong? And more importantly, what are the right tools and techniques for debugging this sort of thing, because running into this kind of problem and not being able to "step through it" in a debugger in any meaningful way is a bummer. Thanks!

    Read the article

  • Cannot copying tables when compiling on Device

    - by Amarpreet
    Hi guys, I am working on sqlite application with around 10 tables in database. it works fine when i run on simulator. And when i open the sqlite file from Applications folder of simulator it shows me all the tables and data. the problem arises when i run app on device. I downloaded the application from device and i checked the sqlite database files there were no tables in it. please help me solving this problem. thanks.

    Read the article

  • How can I check if a TTTabItem gets selected?

    - by schoash
    I have several TTTabGrids in my view and now I am stuck with the problem, that I can't figure out, how to detect, when a TTTabItem gets touched. If someone selects an item in one of the TTTabGrids I should upadate some labels. Can someone tell me a way how to detect, when the selection in a TTTabGrid gets changed? My code looks like this: @interface MyTTTabGrid : TTTabGrid @end @implementation MyTTTabGrid - (id)initWithFrame:(CGRect)frame columns:(NSInteger)columns{ if (self = [super initWithFrame:frame]) { self.style = TTSTYLE(tabGrid); _columnCount = columns; } return self; } @end - (void)viewDidLoad { [super viewDidLoad]; _tabBarHours = [[MyTTTabGrid alloc] initWithFrame:CGRectMake(10, _tabBarZone.bottom+10, 300, 0) columns:7]; _tabBarHours.backgroundColor = [UIColor clearColor]; NSMutableArray *tmpHours = [[NSMutableArray alloc] init]; int i=6; while (i<20) { [tmpHours addObject:[[[TTTabItem alloc] initWithTitle:[NSString stringWithFormat:@"%d", i]] autorelease]]; i++; } _tabBarHours.tabItems = tmpHours; [_tabBarHours sizeToFit]; [self.view addSubview:_tabBarHours]; [tmpHours release]; }

    Read the article

  • Objective-C properties are not being recognized in header file?

    - by Greg
    Hey folks, I wonder if I'm doing something completely stupid here... I'm clearly missing something. I've gotten used to the pattern of defining properties of a custom class, however I seem to be hitting a point where extended classes do not recognize new properties. Case of point, here's my header file: import import "MyTableViewController.h" @interface MyRootController : MyTableViewController { NSMutableArray *sectionList; } @property (nonatomic, retain) NSMutableArray *sectionList; @end Now, for some reason that "sectionList" property is not turning green within my interface file (ie: it's not being recognized as custom property it seems). As a result, I'm getting all kinds of errors down in my implementation. The first is right at the top of my implementation where I try to synthesize the property: import "MyRootController.h" @implementation MyRootController @synthesize sectionList; That synthesize line throws the error "No declaration of property 'sectionList' found in the interface". So, this is really confusing. I'm clearly doing something wrong, although I can't put my finger on what. One thought: I am extending another custom class of my own. Do I need to specify some kind of super-class declaration to keep the architecture from getting sealed one level up? Thanks!

    Read the article

  • iPhone: how to keep integer value on UILabel

    - by Nandakishore
    i am working on Twitter on iPhone now i have to keep the count of Friend, Tweets, Followers etc on UILabel how to work with this (void)userInfoReceived:(NSArray *)userInfo forRequest:(NSString *)connectionIdentifier { NSLog(@"User Info Received: %@", userInfo); // userInfo contains all user details like userName, screenName, count of Friends, Followers, Following, Status Count etc NSLog(@"User Info Received: %d", [userInfo count]); NSMutableDictionary *profileData = [userInfo objectAtIndex:0]; //converting userInfo array into profileData dictionary lblUserName.text = [profileData objectForKey:@"name"]; // lblUserName is UILabel, userName keeping on Label lblLocation.text = [profileData objectForKey:@"location"]; // lblLocation is UILabel, Location keeping on Label lblDescription.text = [profileData objectForKey:@"description"]; // lblDescription is UILabel, Location keeping on Label /////* Up to here all working but how to Keep integer value on UILabel *///// lblFolCount = (NSNumber *)[profileData objectForKey:@"followers_count"]; //how to keep user Followers Count on UILable lblFavCount = (NSNumber *)[profileData objectForKey:@"favourites_count"]; //how to keep user Followers Count on UILable lblStatusCount = (NSNumber *) [profileData objectForKey:@"statuses_count"]; //how to keep user statuses count on UILable lblFriends = (NSNumber *) [profileData objectForKey:@"friends_count"]; //how to keep user friends count on UILable } ////**This info Display on debugger console*/////// ////NSLog(@"User Info Received: %@", userInfo); // by this we get info on debugger console User Info Received: ( { "created_at" = "Tue Nov 02 14:42:42 +0000 2010"; description = "being honest"; favorited = false; "favourites_count" = 0; "followers_count" = 5; "friends_count" = 21; "listed_count" = 0; location = Chennai; name = "nanda kishore reddyv"; "profile_background_color" = EDECE9; "profile_background_image_url" = "http://a2.twimg.com/a/1292975674/images/themes/theme3/bg.gif"; "profile_background_tile" = false; "profile_image_url" = "http://a2.twimg.com/a/1292975674/images/default_profile_6_normal.png"; "retweet_count" = 0; "screen_name" = velugotinanda; source = "<a href=\"http://www.icodeblog.com\" rel=\"nofollow\">iCodeBlog Oauth Demo</a>"; status = "Mon Dec 27 09:22:44 +0000 2010"; "statuses_count" = 15; "time_zone" = "Indiana (East)"; verified = false; } ) 2011-01-01 10:38:29.460 IdeaTweet[471:207] User Info Received: 1 Thanks YOU can you tell me how to Keep integer Value on UILabel

    Read the article

< Previous Page | 150 151 152 153 154 155 156 157 158 159 160 161  | Next Page >