iphone

How can I know if a ModalViewController is being shown?

I override -orientationChanged in my main ViewController to push ModalViewController A when the device is in landscape mode. When placed back in portrait mode, ModalViewController A is dismissed. However, there are other cases (after button touches) where ModalViewControllers B, C, or D are shown. When those are showing, if the device...

How to present a modal view controller on the iphone without a "current" view controller?

I'm trying to open the email view controller (MFMailComposeViewController), and everything I read suggests using presentModalViewController:animated:, which seems to need to be sent to a UIViewController. For example, in the documentation, it says: Call the presentModalViewController:animated: method of the current view controller, ...

Predefines for iPhone os and mac os

Hey guys, As im working on a game engine for my company. i got in the setup fase and i need some predefines to check the os on the device / desktop. I need predefines to check when ever the target os is windows / mac or iphone os. Can any one help me with that? god bless you in advance :). ...

custom button with multiple images

hi all, i have 3 images that i would like to use them to generate my custom button. my images are left.png 5x20, right.png 5x20 and mid.png 1x20. my mid.png must be repeated as long as my text lenght. how can i generate it in iphone application on the fly? thanks. ...

UIActionSheet positioning problem within ScrollView

I'm trying to display a ActionSheet when a screen is touched within scrollview. The action sheet pops fine within 1st page. But on subsequent pages, the screen becomes dark and doesn't displaying anything... as if actual button is displaying on the off screen. I played around with frame positioning of UIActionSheet.. but it doesn't see...

UIImage only loads on iPhone if I change file name to lowercase

I have an image that changes due to a button press. I have the code set up like this: UIImage *example = [UIImage imageNamed: @"Example.png"]; UIImage *stuff = [UIImage imageNamed: @"Stuff.png"]; UIImage *bob = [UIImage imageNamed: @"Bob.png"]; UIImage *thing = [UIImage imageNamed: @"thing.png"]; It used to be so that the last image ...

UITextView inputView

I'm making a custom input method for the iPad, I want to be able to replace the system keyboard with my input method and enter text via that input method. According to the documentation all I need to do is to set the inputView property with my view and it will be used instead of the system keyboard. I did that and it works, as far as sh...

When compiling a static libssh2 library as i386 it always returns an x86_64 library

Hey, Been working on this for hours now so any insight would be greatly appreciated. I'm trying to compile libssh2 for the iPhone Simulator on OS X (I already have it compiled successfully for the device). I'm using the following environment variables and commands: export DEVROOT=/Developer/Platforms/iPhoneSimulator.platform/Develope...

C++ for iphone crash

Hey guys, Im developing a game engine for iphone in C++ but im getting a crash with my Matrix class. I hope you can see whats wrong because i stare my self blind on the crash. /* * Copyright (c) 2010 Johnny Mast * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated docum...

Misalignment in a UITableView using UITableViewCellStyleSubtitle

I have a table with many cells, all using UITableViewCellStyleSubtitle to allow me to have an icon at left with large text to the right above a small subtitle. Pretty straightforward, but my icons vary significantly in width, and as it was the text and subtitle appeared raggedy from one row to the next (farther to the left with narrow i...

Getting a screenshot of a UIScrollView, including offscreen parts

I have a UIScrollView decendent that implements a takeScreenshot method that looks like this: -(void)takeScreenshot { CGRect contextRect = CGRectMake(0, 0, 768, 1004); UIGraphicsBeginImageContext(contextRect.size); [self.layer renderInContext:UIGraphicsGetCurrentContext()]; UIImage *viewImage = UIGraphicsGetImageFromCurre...

How do I achieve the effect of two to-many relationships to the same entity from one entity?

I am having a hard time wrapping my head around data models. Let me start with showing how I would declare the class if I just had to have in-memory objects. @interface PlayerState { NSSet /* of SavedDie */ *savedDice; NSSet /* of SavedDie */ *immediateRolls; } @property (nonatomic, retain) NSSet *savedDice; @property (nonatomic,...

Why is NSXMLParser picking up this whitespace in the foundCharacters method?

Hello. I'm learning to use the NSXMLParser API for the iOS platform and so far it's very easy to use. I'm having a small problem, however, in the foundCharacters method. As I understand it, it shouldn't pick up any whitespace since the foundIgnorableWhitespace method is supposed to catch that, but it looks like it is. Here's the my c...

Do you need Xcode to program iPhone apps?

Possible Duplicates: Develop iPhone app without a Mac? iPhone Programming in Mac OS X runnning not in a Mac Computer hey. i'm 14 and i'm interested in making apps for the iphone. i'm not a noob at programming, but i'm not that good. i have no idea what i'm doing when it comes to Objective-c, but i was wondering if it were poss...

How are the units setup in OpenGL ES 1.0 for iOS?

The example that XCode generates for an OpenGL ES App, creates a square using the following coordinates: static const GLfloat squareVertices[] = { -0.5f, -0.33f, 0.5f, -0.33f, -0.5f, 0.33f, 0.5f, 0.33f, }; How does this generate a square when the sides are clearly of unequal length? Has the scaling been set up ...

Need help in adding a drop shadow to an image in a uiview in iOS4?

I am trying to create a drop shadow for an image. I also have an animation between views and this is the backdrop. However, when I use the following code, the image is not drawn. Anyone have any ideas? self.frontViewBackground = [[[UIView alloc] initWithFrame:frame] autorelease]; //self.frontViewBackground.image = [UIImage imageNamed...

iPhone: Reading many images quickly

I've got an app I'm working on where we handle a LOT of images at once in a scrollview. (Here's how it looks, each blue block being in image on a scrollview expanding to the right: http://i.imgur.com/o7lFx.png) So to be able to handle the large strain doing this puts on memory. So I've implemented a bunch of techniques such as reusing im...

High-resolution timer for iPhone?

I'm looking for high-resolution timing code for iPhone, in order to do some performance timings. I'd like to write code like this: HighResolutionTimer* myTimer = [[HighResolutionTimer alloc]init]; [myTimer start]; [self doSomeLengthyOperation]; NSLog( @"doSomeLengthyOperation took %f seconds", [myTimer elapsedTime] ); ...

iUI: Back button doesn't work in UIWebView

I have a mixed web/native app, and I use a (you guessed it) UIWebView to display the html portion of the app. Do to the nature of the app, I am using the view without any toolbar, including forward/back buttons. The html is designed using iUI. All of the "pages" are contained in the same document using ids to designate page content. Whe...

Facebook API login page in iPhone displays huge webpage.

HI Guys, I tried using facebook API but once i tried integrating it. I noticed that the login form which displays the login form of facebook is so huge that causes it not to fit the whole login window of iPhone. Anyone have an idea how fix this one? Thanks ZaldzBugz ...