2018-10-22         Quintina

Drawing Unicode characters on iPhone

Why is it so hard to figure out how to draw Unicode characters on the iPhone, deriving simple font metrics along the way, such as how wide each imaged glyph is going to be in the font of choice?It looks like it'd be easy with NSLayoutManager, but that API apparently isn't available on the phone. It appears the way people are doing this is to use a private API, CGFontGetGlyphsForUnichars, which won't get you past the Apple gatekeepers into the App store.Can anybody point me to documentation that shows how to do this? I'm losing hair rapidly.Howard I assumed that the exclu...

 iphone                     3 answers                     94 view
 2018-10-22         Dorothy

Question about spinner interface

I'm trying to make an spinner selection interface like the one in the following.http://media.smashingmagazine.com/cdn_smash/wp-content/uploads/2009/10/allRecipies.pngI'm thinking of using rotated UIPickerView to implement it.Do you think it is possible or is there any other better solution?Thanks in advance. These recepies scroll horizontally from left-to-right and back right? Although you can make an UIPickerView to work horizontally (see here). UIPickerView is really ment for vertical scrolling. In this cituation I would really recommend a series of UIScrollViews that ...

 iphone                     1 answers                     37 view
 2018-10-22         Joanne

How do I implement a sprite-sheet in OpenGLES for iPhone?

I am working from the GLSprite sample code example. What I want to know is what do I need to do to the code to have it treat my texture as a sprite-sheet? The only modification I have done so far is to create a 256 x 256 png of 16 smaller images to be my frames. I have never worked with sprite-sheets before. Thanks for your help. You need to adjust the texture coordinates to map the required sprite. Texture coordinates are normally normalised (0 to 1). Assuming you have a 4x4 grid of sprites, the first sprite would have texture coords of...0, 00, 0.250.25, 0.250.25, 0 ...

 iphone                     1 answers                     47 view
 2018-10-22         Len

How to change the image in a cocos2d sprite from an array?

I'm trying to change the image that a sprite from an array is displaying. Here is the code I'm using:((Sprite *)[enemiesArray objectAtIndex:index]).image = baseImage;I get the error message:error: request for member 'image' in something not a structure or unionWhat am I doing wrong?Thanks for reading. I don't think that this is the way to do this.Rather than that you should call one of the init methods:- (id) initWithCGImage:(CGImageRef)image;- (id) initWithTexture:(Texture2D*) tex;- (id) initWithFile:(NSString *) imageFile;In my game i do this differently, i have a cla...

 iphone                     4 answers                     50 view
 2018-10-22         Cherry

Rendering UIView with its children

I have a UIView that has an image and some buttons as its subviews. I'd like to get a "snapshot" image of it using renderInContext, or other method.[clefView.layer renderInContext:mainViewContentContext];If I pass it my UIView (as above) then I get a blank bitmap. None of the children are rendered into the bitmap. If I pass it the child view that is the image, then I get an image of that bitmap, and, unsurprisingly, none of its siblings (buttons). I was sort of hoping that renderInContext would take the image and all it's visible children and render it into a bitmap. Has an...

 iphone                     2 answers                     39 view
 2018-10-22         Roberta

iPhone dev - How far down should I cast?

If I have a method that passes an argument of type void * (UIView animation did stop method, has to be a void pointer), or of type id, and I know that the argument is a UIBarButton item, and I need to disable it, [barbuttonitem setEnabled:NO];, should I cast the argument to a UIControl, which is as far as I need to be able to use setEnabled (without a warning), or should I cast it all the way down to UIBarButtonItem? Why?Thanks!! UIBarItem is not derived from UIControl, so casting to UIControl really isn't the correct thing to do. It works because both classes happen to...

 iphone                     4 answers                     10 view
 2018-10-22         Sibyl

Change iPhone internet connection mode programatically

I want to know if there is a way of changing the internet connection mode from GPRS to WiFi and vice-versa programatically. I am developing one application and want to give liberty to users which internet connection mode they want to use for my application. Also is there any other connection mode available apart from WiFi and GPRS? Any pointer in this regard will be highly appreciated.RegardsAkshay Not with a public API.There's also Bluetooth connectivity, which is used for GameKit and also automatically used for device-to-device Bonjour. [XXX]

 iphone                     1 answers                     26 view
 2018-10-22         Marsh

Loading new view from didReceiveLocalNotification

Ive been searching for a solution for hours and my question is really simple.I have a local notification that fires and i want to load a new view to show the user when the notification has been fired and the user have clicked the "view" button. Is this possible and if so, how do i do it?Thanks in advance :) In your appDelegate put this code:- (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notif {// show your view here!}this method is called when your app receive the local notification and you can also use the "notif" obj...

 iphone                     1 answers                     34 view
 2018-10-22         Myron

iPhone - encode Array of Data from CoreData Entity and store in Base64 String

I have a data model with three entities (Purchase, Items, Image) the purchase is the main with the other two as related attributes.I need to be able to send the data to a web server, and I must encode in base64, I have a couple of classes that take care of the encoding and decoding that i downloaded from the net, they are categories for the NSData class, but when i use them i receive back a null string. // For Error Information NSError *error; // Create a File Manager NSFileManager *fileManager = [NSFileManager defaultManager]; // Point to the Documents Directory NSStri...

 iphone                     1 answers                     80 view
 2018-10-22         Montague

Rotate Address Book Controller

I am wondering if there is some way to rotate a created ABPeoplePickerNavigationController. I am creating the ABPeoplePickerNavigationController like this:ABPeoplePickerNavigationController *addressBook = [[ABPeoplePickerNavigationController alloc] init];addressBook.peoplePickerDelegate = self;[self presentModalViewController:addressBook animated:YES];My application is in landscape mode, and I am wondering how I can get this created controller to rotate like the rest of the application. As the Address Book application does this without any problems, I assume it is a pret...

 iphone                     2 answers                     84 view
 2018-10-22         Lynn

My Iphone App crashes (Bad access) when turned on it's side (landscape mode)

For some reason, every time I run my Iphone App, the App works fine as long as it is upright. The second the simulator turns to the left or right (like if I manually turn it, or if it's trying to play a video), the code crashes, with either a "Bad Access" or an exception.The crazy thing is that this stuff was JUST working, and I didn't change ANYTHING that looks like it would affect landscape mode only. Could something complicated in the background have changed to make this stop working? Is this just a symptom of some sort of memory error?-Jenny Sure, you could be releas...

 iphone                     1 answers                     87 view
 2018-10-22         Prudence

Restrict images in scroll view to stretch when iPhone moved to landscape orientation

I have imageViews as content for in the UIScrollView. If a user is viewing a potrait picture (320x480) and moves the iPhone in landscape orientation - the image stretches to occupy full screen. I want to restrict the image to stretch. I want a functionality similar to the photos app where image is scaled down and shows black strips in left and right.Anyone with any suggestion how I can achieve this - would be a great help! When you rotate, instead of letting your UIIMageView expand, resize its frame to be what you want it to be...that should take care of it. [XXX]

 iphone                     1 answers                     88 view
 2018-10-22         Bert

Multi Part/Form-data action request is not working on iPhone Liferay 7

Hello i am having custom user profile portlet in which i am updating user detail, user password and user profile picture. I can do all this operation successfully from desktop, android phone and iPhone 7, but from iPhone6/6s or iPad i am getting bad request (400) error from the server if i only change/edit the input fields, All works fine if i upload new image and change/edit other fields. I am using Lifeary CE GA 5, tomcat bundle.I don't have any clue how to debug this, any help would be appreciate.Thanks,Dipti In our case the problem was in the submit button. It was de...

 iphone                     1 answers                     73 view
 2018-10-22         Barry

On iphone, how can i get the system date in the proper format

Based on local user settings, I want to get the correct date format. For example, it could be any of these:5 Jan 2010January 5, 20101/5/10And how about on windows?Thanks. Use NSDateFormatter with one of the NSDateFormatterStyle styles. It automatically uses the user's locale. [XXX]NSDate *selected = [NSDate date]; NSDateFormatter *format = [[[NSDateFormatter alloc] init] autorelease]; [format setDateFormat:@"MM/dd/YYYY"]; strDate = [format stringFromDate:selected];Change the format to any thing u want.(M for month, d for day, Y for year, m for minute, h for ...

 iphone                     2 answers                     59 view
 2018-10-22         Aries

Formats for communicating between backend and Objective-C/Cocoa

I'm developing an iPhone app that is connected to a backend server. It needs to communicate with it many times, through several requests. I'm sending HTTP messages, but I want to receive more complex responses that I can parse somehow. Supposedly, I can provide any type of format for responses from the server, so my question is: which one would be easier(maybe even faster) to use/parse for Objective-C/Cocoa, and transform in a dictionary of some kind?I know it's a bit subjective but I still think it's a valid question, some programming languages just have more support for s...

 iphone                     3 answers                     63 view
 2018-10-22         Theodore

NSDictionary initWithContentsOfFile: messes up NSDecimalNumbers, why?

In my iPhone app I employ NSDecimalNumber to store some some currency rate values.I pull the data from the web the first time the app is launched and then again when they become obsolete, and I store them in a NSDictionary; then I use writeToFile:atomically:.When the app is launched for the first time, my rate conversion method works allright. Yet, when I launch the app a second time, and the rates get loaded with -(NSDictionary*) initWithContentsOfFile: the conversion methos stops working, and I get weird results.I did some debug with breakpoints in the incriminated metho...

 iphone                     2 answers                     18 view

Page 1 of 1007  |  Show More Pages:  Top Prev Next Last