iphone

OpenGL-ES change angle of vision in frustrum

Let's see if I can explain myself. When you set up the glFrustrum view it will give the perspective effect. Near things near & big... far things far & small. Everything looks like it shrinks along it's Z axis to create this effect. Is there a way to make it NOT shrink that much? To approach perspective view to an orthographic view.... ...

UITableViewCell not appearing/reusing correctly from NIB

I have created a custom UITableViewCell from a NIB. Everything appears when the rowHeight is not set (albeit, everything is squished). I am not sure if I am reusing and creating the cells properly: // Customize the appearance of table view cells. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath ...

Monotouch creating UIViews with using() blocks

When i first started using monotouch i found a page with some code samples for simple and frequent tasks... but on some of those code samples i found some things like this one: var imageRect = new RectangleF(0f, 0f, 320f, 109f); using (var myImage = new UIImageView(imageRect)) { myImage.Image = UIImage.FromFile("myImage.png"); ...

Do I need to set heightForRowAtIndexPath if I am using a custom UITableViewCell?

Do I need to set heightForRowAtIndexPath if I am using a custom UITableViewCell? In my NIB I have already set the cell height. When I over-ride heightForRowAtIndexPath the contents of my cell don't appear, even though it is set to the height defined in the NIB. If I don't over-ride heightForRowAtIndexPath the contents of the cell appea...

Set Data Roaming on/off in an iPhone through code

I would like to be able to to switch roaming on or off from my app but haven't found much about it, is it possible? Thanks in advance! ...

send xml to server.

Hello. I am recording a video from iPhone and I want to show the video live on a diffrent server. I am using a logic to take the snapshots of images that I am recording then convert imagedata (20 images of recording at one time ) into string and send the string as xml to the server. I can parse the data on the server and save it as i...

Programatically created ViewController and awakeFromNiB?

I am creating a viewController programatically (hopefully the right way) My problem is that I previously created the controller in IB and have code I want to call in awakeFromNib. As I currently have things viewDidLoad works fine but awakeFromNib does not. Is there anyway to get awakeFromNib to call or an alternative method that I can us...

drawRect context Error

Hi, I heard that a lot of people get a context error by not using drawRect Now I have this: - (void)drawRect:(CGRect)rect { NSLog(@"drawRect: Starts"); CGContextRef context = UIGraphicsGetCurrentContext(); CGContextSetRGBStrokeColor(context, 1.0, 1.0, 1.0, 1.0); CGContextSetLineWidth(context, 3.0); CGContextMoveToPoint(co...

Three20 and iOS 4

I'm trying to complie my app for iOS 4. It includes Three20. I've set the base SDK to "iPhone Device 4.0" and the Deployment Target to "iPhone OS 3.0" but I get this message: "_OBJC_CLASS_$_TTURLRequestModel", referenced from: _OBJC_CLASS_$_MockPhotoSource in MockPhotoSource.o What do I have to do? ...

Explanation of `self` usage during dealloc?

I'm trying to lock down my understanding of proper memory management within Objective-C. I've gotten into the habit of explicitly declaring self.myProperty rather than just myProperty because I was encountering occasional scenarios where a property would not be set to the reference that I intended. Now, I'm reading Apple documentation ...

How to resize a UIImageView to fit the underlying image without moving it?

I have a UIImageView whose frame, set before the image is loaded, is always too large for the image, so when I try to round the corners, for example, nothing happens. How can I resize the frame so it's the same size as the underlying image, while ensuring that the center point of the UIImageView does not change? ...

Playing videos in UIWebView broken in iOS4?

I have an app that's worked since version 2.0 of the SDK where I create and add a UIWebView and then load the URL of an .mov to play a movie. Ever since the early version of the 4.0 beta up until the 4.0 GM this has stopped working. When I load a movie now I get the following error: :Plug-in handled load" and the movie never displays. ...

What does the new " Retina Display" mean for iPhone Developers?

Apple announced a higher res display for the iPhone 4, yesterday. What does this mean for developers? More detection code and image swapping? Can and should I just develop for iPhone 4 and let iphone 3 and down scale everything? EDIT: Perhaps the other way is better? ...

Which sorting algorithm is behind an NSSortDescriptor?

Is that thing using bubble sort? Or what exactly? How does it work in context with an NSFetchRequest of Core Data? ...

Best way to save to nsuserdefaults for custom class?

If I have a custom class Person which has three variables (which are propertized and synthesized): NSString* theName; float* theHeight; int theAge; Person instances are stored in an NSArray 'Group'. There is only one Group. What is the best way of storing and loading the Group in NSUserDefaults? (bearing in mind that float and int are...

Older SDK disappeared after installing new Xcode version

Hi Why are old SDKs beeing removed when installing a new version of xcode with new Iphone SDK ? Now we have v4, what settings do I have to make in order that the apps still work with 3.x ? Thanks ...

How is Core Data detecting the conflicts, actually?

Apple says about -detectConflictsForObject: If on the next invocation of save: object has been modified in its persistent store, the save fails. This allows optimistic locking for unchanged objects. Conflict detection is always performed on changed or deleted objects. So what does this mean? If I simply modify an manage...

ocunit testing on iPhone

Hi I am trying to get ocunit working in my project from XCode. Since I also need to debug in the unit tests I am using a script that automates the setup (see below). I just include it in the project under resources and change the name to the .ocunit file I want it to run. The problem I get is that it cant find the bundle file and there...

Should I release NSURL?

Hello, I have the following code: + (BOOL)updateStatus:(NSString *)status forUsername:(NSString *)username withPassword:(NSString *)password { NSURL *loginURL = [NSURL URLWithString:@"XYZ"]; ASIFormDataRequest *loginRequest = [[ASIFormDataRequest requestWithURL:loginURL] retain]; [loginRequest setPostValue:@VALUE forKey:@"SOME_KE...

iphone selecting a row to change view

I have created the view Controllers and attached those to control their respective views. I can't figure out how to make the following code to go the right views though. (This is in the root view controller:) - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { RunViewController *runViewC...