iphone

OpenGL ES - Change hue of colors in texture

Hi everyone, I'm developing a simple 2D-game in OpenGL ES for the iPhone. My problem is that I want to render a texture using different hues. Basically I want to change the hue of the colors in the texture that i render. Simply changing the glColor will not do since it also affects the parts of the image without color. Any ideas? ...

How to secure NSUserDefaults?

Apple advise using NSUserDefaults to store all your app preferences. However, it seems that NSUserDefaults is very easily editable. Is there a way to secure this. I'm not looking for a way to make it impossible to edit, just making it harder so that users won't be so tempted to change application internal variables. ...

Trying to Create an Enterprise Provisioning Profile--Distribution Tab is Missing

I'm attempting to create an Enterprise Provisioning Profile, but the program portal isn't working the way I expect it to (based on the documentation). Here's what I'm seeing: First, I log on as the Team Agent. Second, I navigate to the Provisioning section of the program portal. According to the documentation, I should see 4 tabs at ...

Cocoa touch - problem with button-viewController connection

Hello, I'm very new to cocoa touch and am stuck on a problem that doesn't seem to have a google solution. I have added a view to my application, and this view has a button on it. When the button is pressed I want the callback to perform an operation. My problem is that the callback isn't being called. I created the view in Interface...

IPhone Objective-C only enable a button if NSTextfield is not blank

I have a button that I only want enabled when a textfield is not blank. I have been trying to do this by implementing the following method, without any luck. - (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string{ Is there another delegate method that I could imple...

Cocoa-Touch, Core Data: Compiler cannot find the NSManagedObjectContext (+ other core data classes)

I have an application that will use Core Data. I've added the Core Data framework to the linked library list in XCode. In one of my classes, I try to set up the NSManagedObjectContext along with the other required classes as folows: @interface MyClass : NSObject { NSManagedObjectModel *managedObjectModel; NSManagedObjectContext...

xcode build configurations search paths

my iphone app builds fine in debug configuration, but when i change it to release, i get hundreds of errors, starting with "CoreServices/CoreServices.h: No such file or directory" in AudioFileComponent.h - part of the AudioToolbox framework. i can't find where in the project/build settings is responsible for this.. thanks for any help. ...

iPhone - Record settings give unexpected output with AVAudioRecorder

Hi I am using the AVAudioRecorder class to record a wav file. These are the settings that I use for recording recordSetting = [[NSMutableDictionary alloc] init]; [recordSetting setValue :[NSNumber numberWithInt:kAudioFormatLinearPCM] forKey:AVFormatIDKey]; [recordSetting setValue:[NSNumber numberWithFloat:44100.0] forKey:AVSampleRateK...

Random AI / Switch case?

So I have a very simple game going here..., right now the AI is nearly perfect and I want it to make mistakes every now and then. The only way the player can win is if I slow the computer down to a mind numbingly easy level. My logic is having a switch case statement like this: int number = randomNumber case 1: computer moves the comp...

How do you handle section inserts with an NSFetchedResultsController?

I've got an NSFetchedResultsController as my data source and and I implement NSFetchedResultsControllerDelegate in my custom UITableViewController. I'm using sectionNameKeyPath to break my result set into multiple sections. In one of my methods, I'm adding a couple of objects to the context, all of which are in a new section. At the m...

Turn off Zooming in UIScrollView

Does anyone know a way to temporarily turn off zooming when using a UIScrollView? I see that you can disable scrolling using the following: self.scrollView.scrollEnabled = false; but I'm not seeing a similar command for zooming. Any thoughts? ...

Cocoa-Touch: How do I see if two NSDates are in the same day?

I need to know if two NSDate instances are both from the same day. Is there an easier/better way to do it than getting the NSDateComponents and comparing day/month/year? ...

iPhone button with non-rectangle shape?

How can I get a non-rectangular shaped button? For example I do have a PNG image with alpha transparency. How can I set the shape of a button to this image without the transparent color. ...

[TDD] Testing Target-Action wiring

Hi, i came across the following blog post that explained the topic. However I do have troubles with the given samples. It verifies target-action binding like so: STAssertEquals([doSomethingButton action], @selector(doSomething:), @"The button should send -doSomething: to its target."); STAssertEquals([doSomethingButton target], _wi...

Cocoa-Touch, Core Data: Getting exception when trying to insertNewObjectForEntityForName:inManagedObjectContext:

I'm following this how-to to implement Core Data storage in my app: I have a Model.xcdatamodel which defines a Something model. I've used XCode to generate a class for that model. I've imported the class in my .m file where I'm trying to: Something* s = (Something *)[NSEntityDescription insertNewObjectForEntityForName:@"Something" inM...

iPhone SDK view scrolling not rubber banding or using momentum from swipes

Hi, I'm having a fundamental problem with getting scrolling to work normally on my iPhone app. I have two views, each created in IB (although I've tried this programmatically and it makes no difference) which scroll very sloppily. Instead of the scrolling that we're used to (which is smooth and continues to scroll and eventually dampen...

Call a method when switchig views with UITabBar

Is there any way to automatically call a custom method when switching views usig a UITabBarController? Like, I want to he able to, when I set a NSString in one view in a UILabel, haave it automatically update a different label on a different tab with the same string. Thank you! ...

Iphone Scrollview Question

Hi there, i am quit new at iphone development and trying to make a photo collage software while learning it. Right now i have a lil problem and hope you can help me out. I have an UiviewController with a view in it, in this view i have 7 scrollviews with uiimagevies in them for zooming and scollign images within these scrollviews. All...

Shadow or Border around a scrollview iphone

Hi there, i would like to draw a border / shadow around a uiscrollview, i know that i could get there with an additional view or scrollview but dont like the handling an drawbacks but i heard that there should be a possibility to dirctly draw a border to a scrollview and that is what i would prefer. I am quit new to iphone dev so if th...

Best practice? - Array/Dictionary as a Core Data Entity Attribute

I am new to Core Data. I have noticed that collection types are not available as attribute types and would like to know what the most efficient way is of storing array/dictionary type data as an attribute (e.g. the elements that make up an address like street, city, etc. does not require a separate entity and is more conveniently stored ...