iphone

Using RoR and Active Record Session to implement a cheat-free game server

Hello. I'm diving into RoR and plan to build a few websites. Alongside the websites, I'd like to use RoR to build a simple RESTful game server API that can be used to orchestrate a two-player iOS game that I'm writing. The game is puzzle-based time challenge (the first player to solve the puzzle wins) and the players will only be comm...

Access files in "private Documents" folder transferred with iTunes

Hi, currently i'm trying to access the files that are transferred using the new ios feature introduced with 3.2. - (NSString *)getPrivateDocsDir { NSArray *paths = NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; documentsDirectory = [do...

Issue with NSDatePicker

Hi, I want to show only day and month and not year in my date picker. Not sure how to achieve this. Please suggest. ...

asp.net MVC authentican for iphone and blackberry app

I am working on an asp.net mvc rest webservice for traffic updates. This web-service will provide information for an iphone and blackberry application. Users need to log in to store things like their favorite routes and to create new routes. What type of authentication should be used? I am thinking of basic authentication where i give...

iphone: co-processor offset out of range

hi, i have a strange compiling problem with xcode and iphone. my game is almost finish but now i got suddently this compiling error: {standard input}:6108:co-processor offset out of range gcc-4.2 failed with exit code 1 this only happens if i compile the release version for the device. the debug version and both versions for the simu...

UIView within UIView

Im wondering what I am doing wrong: Create xib and add on it UIView "FirstView". Under this UIView "FirstView" add another UIView "SecondView". On the FirstViewController load SecondView from nib. it works at this point. Whats not working is that the "FirstView" doesnt seem to change after point 3. So the "SecondView" is properly loa...

How to use UITextView in UITableViewCell with variable height?

I am interested in creating a UITableViewCell with a UITextView inside of it, which adjusts its height (to a certain maximum) as the user types more or less text into the UITextView. I know how to add the UITextView to a custom UITableViewCell--but how might I change the UITableViewCell's height as the user is in the process of typing? I...

Passing matrix of variable size to a method in Objective C

Dear all, I have a 2 by 2 square matrix with real intries that I want to pass to a method. It looks as; double coefficients[2][2] = { { 1.00, 0.6789140 }, {0.4446350, 0.4301290 } }; [self PrintOut:?????? andNRows:2 andNColumns:2]; - (void) PrintOut:(double ?????? andNRows:(NSInteger)rows andNColumns:(NSInteger)columns { // do some...

Continuously drawing into an iPhone bitmap object? What am I missing?

I am pretty sure this is a straightforward problem I must be confused about (I am a total newbie on the iPhone): I am trying to continuously draw shapes using the CG APIs into a bitmap object, and to always show an up-to-date version of that bitmap on the screen, inside a UIScrollView object so the user can pan, zoom, etc. Using UIView...

How to change UITabBarController More button's title?

I have a Tab Bar app. The app has 8 UITabBarItems and the More button is added automatically. I want to change the title from More to something else. I have already tried the following: tabbarController.moreNavigationController.tabBarItem.title=@"Test"; But it still displays "More". No error. No changes. How can I change the "More" ...

Is there an customizable picture gallery service which can be included into an website and an iPhone app?

I need an image gallery solution which can be used with an simple API for uploading photos from the web as well as from the iPhone / iPod touch / iPad, and then view those photos on the web as well as on the mobile devices. Basically what I want to do is this: My cookbook app has recipes for yummy meals. I want to add an global image ga...

Nested UIScrollViews scrolling simultaneously

I have two nested UIScrollViews: the parent limited to horizontal paging and the child limited to vertical scrolling. The content is one large view that can be freely dragged around, but snaps to one of three horizontal sections. The default behavior of the nested scroll views is to only allow scrolling in one direction at a time, but ...

Error while fetch in core data

I get an error with setPropertyToFetch. Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSCFArray initWithObjects:count:]: attempt to insert nil object at objects[0]' code: NSString *str; str = [NSString stringWithFormat:@"Event%d", variable]; NSString *value = [NSString stringWithFormat:@"val...

Detecting when UITextField text has changed due to shake undo?

I have a UITextFieldDelegate that does a whole bunch of validation on user input to determine whether or not they should be allowed to end editing. In one particular example, it is not valid to leave the field blank. Right now I'm using textField:shouldChangeCharactersInRange:replacementString: to validate the text input after each edi...

Determining which view touch was in for all touches

I want to determine which view touches occurred in for the entire application, for the purpose of logging touches so that I can go through the logs later and determine what the user did. I know I could subclass UIView and override touchesBegan/Ended to log those, but I am using many instances of UIButton, UISlider, etc in Interface Build...

Issue with webkit tap highlight color not being applied

I'm having trouble to get the -webkit-tap-highlight-color property to apply to a div - I'm at a loss as to why it isn't. Copying all the styles that apply to it below. The desired outcome is a back button as shown here: http://building-iphone-apps.labs.oreilly.com/ch03.html#ch03_id35932102 .backButton { font-weight: bold; text-align...

UIImage from a region of UIView

Hi, I'm trying to clip a region of an UIView, into a UIImage for later reuse. I've worked out this code from some snippets: CGRect _frameIWant = CGRectMake(100, 100, 100, 100); UIGraphicsBeginImageContext(view.frame.size); [view.layer renderInContext:UIGraphicsGetCurrentContext()]; //STEP A: GET AN IMAGE FOR THE FULL FRAME UIIm...

Where to store a small NSArray of NSDictionaries? Not in my yard!

I have a UITableView with some login form and I manually wrote the configuration values of the UITextFields in this NSArray as NSDictionaries. It is bothering because it's data in the code. I don't want data in my code! And I think that nobody wants that. Have you ever been in this situation? How would you dispose properly of this data?...

Algorithm to find an image in an array using minimum size constraint

Hello, I have an array containing image objects. I am looking for an image nearest my size constraint. For exemple I want an image equal to 400x600 or nearest. By nearest I mean nearest by size, a little bit bigger or smaller. I am not looking for an implementation just for an algorithm. Do you have an idea how to achieve this ? Tha...

Why do I get a leak when using CFPropertyListCreateDeepCopy?

I am creating a deep mutable copy of a dictionary but for some reason am getting a leak. I've tried this: NSMutableDictionary *mutableCopy = (NSMutableDictionary *)CFPropertyListCreateDeepCopy(kCFAllocatorDefault, sectionedDictionaryByFirstLetter, kCFPropertyListMutableContainers); self.copyOfSectionedDictionaryByFirstLetter = mutableCo...