Search Results

Search found 19072 results on 763 pages for 'iphone sdk 4'.

Page 147/763 | < Previous Page | 143 144 145 146 147 148 149 150 151 152 153 154  | Next Page >

  • Read large file into sqlite table in objective-C on iPhone

    - by James Testa
    I have a 2 MB file, not too large, that I'd like to put into an sqlite database so that I can search it. There are about 30K entries that are in CSV format, with six fields per line. My understanding is that sqlite on the iPhone can handle a database of this size. I have taken a few approaches but they have all been slow 30 s. I've tried: 1) Using C code to read the file and parse the fields into arrays. 2) Using the following Objective-C code to parse the file and put it into directly into the sqlite database: NSString *file_text = [NSString stringWithContentsOfFile: filePath usedEncoding: NULL error: NULL]; NSArray *lineArray = [file_text componentsSeparatedByString:@"\n"]; for(int k = 0; k < [lineArray count]; k++){ NSArray *parts = [[lineArray objectAtIndex:k] componentsSeparatedByString: @","]; NSString *field0 = [parts objectAtIndex:0]; NSString *field2 = [parts objectAtIndex:2]; NSString *field3 = [parts objectAtIndex:3]; NSString *loadSQLi = [[NSString alloc] initWithFormat: @"INSERT INTO TABLE (TABLE, FIELD0, FIELD2, FIELD3) VALUES ('%@', '%@', '%@');",field0, field2, field3]; if (sqlite3_exec (db_table, [loadSQLi UTF8String], NULL, NULL, &errorMsg) != SQLITE_OK) { sqlite3_close(db_table); NSAssert1(0, @"Error loading table: %s", errorMsg); } Am I missing something? Does anyone know of a fast way to get the file into a database? Or is it possible to translate the file into a sqlite format that can be read directly into sqlite? Or should I turn the file into a plist and load it into a Dictionary? Unfortunately I need to search on two of the fields, and I think a Dictionary can only have one key? Jim

    Read the article

  • iPhone - User Defaults and UIImages

    - by Staros
    Hello, I've been developing an iPhone app for the last few months. Recently I wanted to up performance and cache a few of the images that are used in the UI. The images are downloaded randomly from the web by the user so I can't add specific images to the project. I'm also already using NSUserDefaults to save other info within the app. So now I'm attempting to save a dictionary of UIImages to my NSUserDefaults object and get... -[UIImage encodeWithCoder:]: unrecognized selector sent to instance I then decided to subclass UIImage with a class named UISaveableImage and implement NSCoding. So now I'm at... @implementation UISaveableImage -(void)encodeWithCoder:(NSCoder *)encoder { [encoder encodeObject:super forKey:@"image"]; } -(id)initWithCoder:(NSCoder *)decoder { if (self=[super init]){ super = [decoder decodeObjectForKey:@"image"]; } return self; } @end which isn't any better than where I started. If I was able to convert an UIImage to NSData I would be good, but all I can find are function like UIImagePNGRepresentation which require me to know what type of image this was. Something that UIImage doesn't allow me to do. Thoughts? I feel like I might have wandered down the wrong path...

    Read the article

  • iPhone app: How to implement in-app purchased game levels

    - by Wonderflonium
    So, I understand that it's possible to set up in-app purchases for iPhone apps to purchase non-consumables like game levels. I understand the logic behind the purchase part, but what I don't understand is, how can I deliver the new game level. For example: I build an app that contains the first level and they purchase additional levels. Is it better to build all the other levels into the app and whenever they purchase the app, it unlocks it with a plist entry or something? That doesn't seem very update-able to me. Every time I come up with a new level, I'd have to update the app. So, what I don't understand then, is what is how do I package up a level and download it as a separate entity that can accessed by the game? Would the level just be some XML with images in a ZIP folder or something? How does the level get added to the game? What are best practices for this type of thing? I Googled and have found NOTHING about this. I'm a little bit confused by the concept and any help would be appreciated. I'm not looking for someone to write the game for me, I just need pointed in the right direction so I can develop it on my own.

    Read the article

  • Integrating twitpic OAuth for iPhone.

    - by asadqamber
    How can I integrate twitpic API with OAuth for posting an image from iPhone? Any help or tutorial? Currently I am doing... NSURL *twitpicURL = [NSURL URLWithString:@"http://api.twitpic.com/2/upload.format"]; theRequest = [NSMutableURLRequest requestWithURL:twitpicURL]; [theRequest setHTTPMethod:@"POST"]; // Set the params NSString *message = theMessage; [theRequest addValue:@"http://api.twitter.com/" forHTTPHeaderField:@"OAuth realm"]; [theRequest addValue:TWITPIC_API_KEY forHTTPHeaderField:@"oauth_consumer_key"]; [theRequest addValue:@"HMAC-SHA1" forHTTPHeaderField:@"oauth_signature_method"]; [theRequest addValue:USER_OAUTH_TOKEN forHTTPHeaderField:@"oauth_token"]; [theRequest addValue:USER_OAUTH_SECRET forHTTPHeaderField:@"oauth_secret"]; [theRequest addValue: @"1272325550" forHTTPHeaderField:@"oauth_timestamp"]; [theRequest addValue:nil forHTTPHeaderField:@"oauth_nonce"]; [theRequest addValue:@"1.0" forHTTPHeaderField:@"oauth_version"]; [theRequest addValue:nil forHTTPHeaderField:@"oauth_signature"]; NSMutableData *postBody = [NSMutableData data]; [postBody appendData:[[NSString stringWithFormat:@"Content-Disposition: form-data; name=\"source\"\r\n\r\n"] dataUsingEncoding:NSUTF8StringEncoding]]; [postBody appendData:[[NSString stringWithFormat:@"lighttable"] dataUsingEncoding:NSUTF8StringEncoding]]; // Message [postBody appendData:[[NSString stringWithFormat:@"Content-Disposition: form-data; name=\"message\"\r\n\r\n%@", message]dataUsingEncoding:NSUTF8StringEncoding]]; // Media [postBody appendData:[[NSString stringWithFormat:@"Content-Disposition: form-data; name=\"media\"; filename=\"%@\"\r\n", @"doc_twitpic_image.jpg"] dataUsingEncoding:NSUTF8StringEncoding]]; [postBody appendData:[[NSString stringWithFormat:@"Content-Type: image/jpg\r\n"] dataUsingEncoding:NSUTF8StringEncoding]]; // data as JPEG [postBody appendData:[[NSString stringWithFormat:@"Content-Transfer-Encoding: binary\r\n\r\n"] dataUsingEncoding:NSUTF8StringEncoding]]; [postBody appendData:[NSData dataWithData:image]]; [theRequest setHTTPBody:postBody]; [theRequest setValue:[NSString stringWithFormat:@"%d", [postBody length]] forHTTPHeaderField:@"Content-Length"]; theConnection = [[NSURLConnection alloc] initWithRequest:theRequest delegate:self];

    Read the article

  • Facebook Connect iPhone API logout not working

    - by Hunter Bridges
    I am attempting to write a Facebook integration in an iPhone app I'm working on. I have it logging in just fine, but I don't like the idea of being able to turn a feature on without being able to turn it off. So, in working on the logout functionality, I have been caught in a snag. - (IBAction) logoutClicked:(id)sender { if (fbLoggedIn) { FBSession * mySession = [FBSession session]; [mySession logout]; } } - (void)sessionDidLogout:(FBSession*)session { NSLog(@"Session logged out."); [theLoginButton setTitle:@"Facebook Time!" forState:UIControlStateNormal]; fbLoggedIn = FALSE; theLogoutButton.enabled = NO; theLogoutButton.alpha = 0; } The logoutClicked method responds to a button in my xib. The delegate method is not getting called. I have tried setting the Facebook session as a property in my ViewController in order to store/access the data across methods, but that didn't seem to work either. Anybody have any solutions?

    Read the article

  • Touch coordinates in iPhone landscape mode app

    - by gok
    I am trying to make this landscape only iphone app. I only use this code for this purpose: - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return (interfaceOrientation == UIInterfaceOrientationLandscapeRight); } However when I click clip subviews checkbox from interface builder, the view is clipped from the middle. I also don't receive any touch events from outside of view bounds obviously. - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { CGPoint fingerPos = [[touches anyObject] locationInView:self.view]; NSLog(@"%f %f",fingerPos.x,fingerPos.y); } only prints for coordinates between 20 and 320 for X. But Y works fine. When i try to modify bounds by hand, everything works fine; View is positioned and shown correctly, printed coordinates are correct, I receive touch from all of the screen except between 0 and 20 for X. So Left side of the screen is unresponsive to touch events for only 20 pixels. Code I use to modify bounds: self.view.bounds = CGRectMake(-180.0f, 0.0f, 680.0f, 480.0f); What might be causing this? Weird!

    Read the article

  • glitchy stuttery iphone game loop

    - by Adam
    This is a problem I've been trying to solve for a few days now, and I've looked at the various solutions on stackoverflow and nothing has really seemed to work for me. I'm making an iPhone game with OpenGLES graphics and accelerometer input, at this point it's very simple, but the rendering is already pretty bad... it stutters and seems to jump back or forward in time. It doesn't happen a lot, but it happens enough to be a problem. I mean, who wants to play a game where a bullet gets magically transported into the player, and then it's game over? No one. I've tried using NSTimer for the game loop, I've tried using a separate thread (with a frame rate and continuously) I've tried using different frame rates, from 30FPS to 60FPS (It seems to have a max frame rate around 45FPS, but no problems at 30FPS) I've tried using timeIntervalSince1970 and CFGetAbsoluteTime to measure loop time, with no noticeable diffence Anyone have any ideas on what is the best way to get this looking better? One of the posts I've read suggested running the simulation at a fixed frame rate and then just render as fast as possible, does that seem like a good idea?

    Read the article

  • Ability to draw and record a signature as part of a form - iphone

    - by mustic
    Apolgies in advance for any errors.. new to this and am not a developer/programmer.. just have some basic unix experience. I have searched the web and struggled to find a solution to my problem when I stumbled onto this website which maybe suggested that there is a solution to my question. For work i use a windows mobile device because we have to get customers to sign and form after a customer visit. the signature being very important. On the windows device i use the notes application and am able to record details and obtain/record (using draw) a customer signature. the form is then emailed back to HQ. The format being used is a *.pwi I have downloaded and paid for several applications for my iphone which is my preferred device and cant quite find anything that does both. the critical bit here is to be able to take a signature on the phone, save the doc in a format such as .txt, .doc or .pdf where i can control the file name then be able to email back to HQ. Am i asking too much? I hope that makes sense.. Any help would be much appreciated many thanks in advance

    Read the article

  • Symbolicate adhoc iphone app crashes.

    - by gotye
    Hey everyone, I can't manage to make my code symbolicated ... I read the part "below" : Given a crash report, the matching binary, and its .dSYM file, symbolication is relatively easy. The Xcode Organizer window has a tab for crash reports of the currently selected device. You can view externally received crash reports in this tab - just place them in the appropriate directory. This is the same as the Mac OS X directory described in the first section. It doesn't matter which device you have tethered, but the directory in which you place the crash report must be the directory for the tethered and selected device. It is not necessary to place the binary and .dSYM file in any particular location. Xcode uses Spotlight and the UUID to locate the correct files. It is necessary, though, that both files be in the same directory and that this directory is one that is indexed by Spotlight. Anywhere in your home directory should be fine. But it doesn't work for me ... here is what I did : I opened xcode organizer and I had my iphone device with crash logs App and dsym files are in my xcode project which is on my desktop All the rest should be automatic, right ? but crash logs aren't symbolicated yet ... Any comments welcome. Cheers. Gotye.

    Read the article

  • iPhone app crashes on start-up, in stack-trace only messages from built-in frameworks

    - by Aleksejs
    My app some times crashes at start-up. In stack-trace only messages from built-in frameworks. An excerpt from a crash log: OS Version: iPhone OS 3.1.3 (7E18) Report Version: 104 Exception Type: EXC_BAD_ACCESS (SIGBUS) Exception Codes: KERN_PROTECTION_FAILURE at 0x000e6000 Crashed Thread: 0 Thread 0 Crashed: 0 CoreGraphics 0x339305d8 argb32_image_mark_RGB32 + 704 1 CoreGraphics 0x338dbcd4 argb32_image + 1640 2 libRIP.A.dylib 0x320d99f0 ripl_Mark 3 libRIP.A.dylib 0x320db3ac ripl_BltImage 4 libRIP.A.dylib 0x320cc2a0 ripc_RenderImage 5 libRIP.A.dylib 0x320d5238 ripc_DrawImage 6 CoreGraphics 0x338d7da4 CGContextDelegateDrawImage + 80 7 CoreGraphics 0x338d7d14 CGContextDrawImage + 364 8 UIKit 0x324ee68c compositeCGImageRefInRect 9 UIKit 0x324ee564 -[UIImage(UIImageDeprecated) compositeToRect:fromRect:operation:fraction:] 10 UIKit 0x32556f44 -[UINavigationBar drawBackButtonBackgroundInRect:withStyle:pressed:] 11 UIKit 0x32556b00 -[UINavigationItemButtonView drawRect:] 12 UIKit 0x324ecbc4 -[UIView(CALayerDelegate) drawLayer:inContext:] 13 QuartzCore 0x311cacfc -[CALayer drawInContext:] 14 QuartzCore 0x311cab00 backing_callback 15 QuartzCore 0x311ca388 CABackingStoreUpdate 16 QuartzCore 0x311c978c -[CALayer _display] 17 QuartzCore 0x311c941c -[CALayer display] 18 QuartzCore 0x311c9368 CALayerDisplayIfNeeded 19 QuartzCore 0x311c8848 CA::Context::commit_transaction(CA::Transaction*) 20 QuartzCore 0x311c846c CA::Transaction::commit() 21 QuartzCore 0x311c8318 +[CATransaction flush] 22 UIKit 0x324f5e94 -[UIApplication _reportAppLaunchFinished] 23 UIKit 0x324a7a80 -[UIApplication _runWithURL:sourceBundleID:] 24 UIKit 0x324f8df8 -[UIApplication handleEvent:withNewEvent:] 25 UIKit 0x324f8634 -[UIApplication sendEvent:] 26 UIKit 0x324f808c _UIApplicationHandleEvent 27 GraphicsServices 0x335067dc PurpleEventCallback 28 CoreFoundation 0x323f5524 CFRunLoopRunSpecific 29 CoreFoundation 0x323f4c18 CFRunLoopRunInMode 30 UIKit 0x324a6c00 -[UIApplication _run] 31 UIKit 0x324a5228 UIApplicationMain 32 Journaler 0x000029ac main (main.m:14) 33 Journaler 0x00002948 start + 44 File main.m is simple as possible: #import <UIKit/UIKit.h> int main(int argc, char *argv[]) { NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; int retVal = UIApplicationMain(argc, argv, nil, nil); // line 14 [pool release]; return retVal; } What my cause the app to crash?

    Read the article

  • iPhone programming - problem with CoreFoundation forking

    - by Tom
    Hello all, I've been working on an iPhone for several months. It's a 2d shooting game akin to the old Smash TV type games. I'm doing everything alone and it has come out well so far, but now I am getting unpredictable crashes which seem to be related to CoreFoundation forking and not exec()ing, as the message __THE_PROCESS_HAS_FORKED_AND_YOU_CANNOT_USE_THIS_COREFOUNDATION_FUNCTIONA LITY___YOU_MUST_EXEC__ always shows up somewhere in the debugger. Usually it shows up around a CFRunLoopRunSpecific and is related to either a timer firing or _InitializeTouchTapCount. I cannot figure out exactly what is causing the fork to occur. My main game loop is running on a timer, first updating all the logic and then drawing everything with openGL. There is nothing highly complex or unusual. I understand you cannot make CF calls on the childside of a fork, or access shared memory and things like that. I am not explicitly trying to fork anything. My question is: can anyone tell me what type of activity might cause CoreFoundation to randomly fork like this? I'd really like to finish this game and I don't know how to solve this problem. Thanks for any help.

    Read the article

  • iphone webview dynamic font support

    - by Kiran
    Friends, I am trying to build a simple iphone application to view a local webpage that uses dynamic fonts. The url is www.eenadu.net. I have just a single view based application and inserted a webview into the view and implementing the webviewdelegate in viewcontroller. The site uses ttf/eot fonts that are dynamically downloadable by browser from http://www.eenadu.net/eenadu.ttf or http://www.eenadu.net/EENADU0.eot. Here is what I am doing in the code by doing some research: Code: ( void ) loadFont { NSString *fontPath = [[NSBundle mainBundle] pathForResource:@"eenadu" ofType:@"ttf"]; CGDataProviderRef fontDataProvider = CGDataProviderCreateWithFilename([fontPath UTF8String]); // Create the font with the data provider, then release the data provider. customFont = CGFontCreateWithDataProvider(fontDataProvider); CGDataProviderRelease(fontDataProvider); fontPath = [[NSBundle mainBundle] pathForResource:@"eenadu" ofType:@"eot"]; fontDataProvider = CGDataProviderCreateWithFilename([fontPath UTF8String]); // Create the font with the data provider, then release the data provider. customFont = CGFontCreateWithDataProvider(fontDataProvider); CGDataProviderRelease(fontDataProvider); } (void) viewDidLoad { [super viewDidLoad]; [self loadFont]; [webView setBackgroundColor:[UIColor whiteColor]]; NSString *urlAddress = @"http://www.eenadu.net/"; NSURL *url = [NSURL URLWithString:urlAddress]; NSURLRequest *requestObj = [NSURLRequest requestWithURL:url]; [webView loadRequest:requestObj]; } I see that the page loads however doesn't display the font. Please help. Also, For loadFont, I have included the fonts in the build with right names and took care of the case as well.

    Read the article

  • iPhone multitouch - Some touches dispatch touchesBegan: but not touchesMoved:

    - by zkarcher
    I'm developing a multitouch application. One touch is expected to move, and I need to track its position. For all other touches, I need to track their beginnings and endings, but their movement is less critical. Sometimes, when 3 or more touches are active, my UIView does not receive touchesMoved: events for the moving touch. This problem is intermittent, and can always be reproduced after a few attempts: Touch the screen with 2 fingers. Touch the screen with another finger, and move this finger around. The moving finger always dispatches touchesBegan: and touchesEnded:, but sometimes does not dispatch any touchesMoved: events. Whenever the moving touch does not dispatch touchesMoved: events, I can force it to dispatch touchesMoved: if I move one of the other touches. This seems to "force" every touch to recheck its position, and I successfully receive a touchesMoved: event. However, this is clumsy. This bug is reproducible on both the iPhone 2G and 3GS models. My question is: How do I ensure that my moving touch dispatches touchesMoved: events? Does anyone have any experience with this issue? I've spent few fruitless days searching the web for answers. I found a post describing how to sync touch events with the VBL: http://www.71squared.com/2009/04/maingameloop-changes/ . However, this has not solved the problem. I really don't know how to proceed. Any help is appreciated!

    Read the article

  • trackPageView on Google Analytics for iPhone Not Working

    - by DigitalZombieKid
    I'm trying to get Google Analytics working on an iPhone application without much luck. I've followed all the instructions on their website (google/apis/analytics/docs/tracking/mobileAppsTracking.html) and studied their sample application (google/gaformobileapps/GoogleAnalyticsIphone_0.7.tar.gz). When I run my application and go to Google Analytics' website (https://www.google.com/analytics/reporting/), the only page that is recording is /app_entry_point. I'm seeing one count in my Google Analytics detailed report once every time my app fires up. However, I have added other pages to be tracked but it's not working. Here is a sample of two pages I've added to be tracked: trackPageview:@"/calculator"; trackPageview:@"/tellafriend"; I call them from various ViewControllers in the app. In each of those view controllers I import the the GANTracker header: #import "GANTracker.h" I'll admit it: I'm an objective-c newbie. Any help you can offer is greatly appreciated! Do I need to physically dispatch them to get the trackPageview working? If so, why is the /app_entry_point page the only page that is recorded by Google Analytics?

    Read the article

  • iphone mkmapview

    - by karthik
    Hi, This is karthik. I am developing an app using mapview in iphone. I have to use two different pins to show user locations. That two users are different type . One user is belong to some category and another one is some other category. I have to check that category and want to plot pin depend upon that category. When I try to do that, that pin is not showing properly. For a certain category it shows another pin, not what i set there. Can anyone help me? What i need is i want to load two different pins in map depend upon some category. For example , if that category is shopping mall then i have to show building image then if there is any garden i have to show some other image at a same time not one by one . I want to plot two pins with different category at the same time. For that,what could i do? I tried lot of solution , but its not showing properly. Help me?

    Read the article

  • Rotating an object in OpenGL ES for iPhone [translate to origin --> rotate --> translate back is not

    - by ayanonagon
    I recently started working with OpenGL ES for the iPhone, and I am having a bit of trouble with it. I want to be able to rotate an object with your fingers. My problem is that I have my object placed at (0, 0, -3), and I would like to rotate it about its center. I know that I need to translate back to the origin, rotate, and then bring it back to the original place. I think I am facing a problem because I am using a matrix to keep track (?) of all of my rotations/translation/scaling etc, and I think it may be combining the operations in a way that order is not even considered (so the two translations would cancel each other). I just started learning OpenGL a day ago and am a complete newbie, so my assumption may be wrong. Here is the part of the in drawView that I am having trouble with: GLfloat matrix[16]; glGetFloatv(GL_MODELVIEW_MATRIX, matrix); glLoadIdentity(); glTranslatef(0, 0, 3); // bring to origin glRotatef(self.angle, self.dy, self.dx, 0); // rotate glTranslatef(0, 0, -3); // put it back in place glMultMatrixf(matrix); // save the transformations performed Help would be much appreciated, thank you!

    Read the article

  • Looping HTML5 audio on the iPhone

    - by Peeps
    I'm trying to make a HTML5 webapp that simply plays a sound over and over and over again, on my iPhone. I don't know any Obj-C to do it natively. What I have works fine, but the sound only plays once: <!DOCTYPE html> <html> <head> <title>noisemaker!</title> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <meta name="viewport" content="maximum-scale=1, minimum-scale=1, width=device-width, user-scalable=no" /> <meta name="apple-mobile-web-app-capable" content="yes" /> </head> <body> <audio src="noise.mp3" autoplay controls loop></audio> </body> </html> Is there a way to either bypass the QuickTime audio screen and loop it in the webpage, or get the QuickTime audio screen to loop the sound?

    Read the article

  • iPhone: variable type returned by yajl

    - by Luc
    Hello, I'm quite new to iphone programming and I want to do the following stuff: get data from a JSON REST web server parse the received data using YAJL Draw a graph with those data using core-plot So, 1th item is fine, I use ASIHttpRequest which runs as espected 3rd is almost fine (I still have to learn how to tune core-plot). The problem I have is regarding 2nd item. I use YAJL as it seems to be the faster parser, so why not give it a try :) Here is the part of code that gets the data from the server and parse them: // Get server data response_data = [request responseData]; // Parse JSON received self.arrayFromData = [response_data yajl_JSON]; NSLog(@"Array from data: %@", self.arrayFromData); The parsing works quite well in fact, the NSLog output is something like: 2010-06-14 17:56:35.375 TEST_APP[3733:207] Array from data : { data = ( { val = 1317; date = "2010-06-10T15:50:01+02:00"; }, { val = 1573; date = "2010-06-10T16:20:01+02:00"; }, ........ { val = 840; date = "2010-06-11T14:50:01+02:00"; }, { val = 1265; date = "2010-06-11T15:20:01+02:00"; } ); from = "2010-06-10T15:50:01+02:00"; to = "2010-06-11T15:20:01+02:00"; max = "2590"; } According to th yajl-objc explanations http://github.com/gabriel/yajl-objc, the parsing returns a NSArray... The thing is... I do not know how to get all the values from it as for me it looks more like a NSDictionary than a NSArray... Could you please help ? Thanks a lot, Luc edit1: it happens that this object is actually a NSCFDictionary (!), I am still not able to get value from it, when I try the objectFromKey method (that should work on a Dictionary, no ?) it fails.

    Read the article

  • How to disable vertical bounce/scroll on iPhone in a mobile web application

    - by Kasper Skov
    As the title says, i need to disable vertical bounce on iphone on my mobile web form application. Ive tried alot of different things, but most of them disables my form or horizontal scroll and bounce as well. Any ideas? Im using jquery.mobile btw :) Update: I actually managed to get the code from the first answer working somewhat: function stopScrolling( touchEvent ) { touchEvent.preventDefault(); } document.addEventListener( 'touchstart' , stopScrolling , false ); document.addEventListener( 'touchmove' , stopScrolling , false ); The reason why I couldnt get it to work in the first place, was that there actually was some margin on my body (stupid me). But. As the layout is fluid and im using jquery.mobile and have <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> in the header (I think) it doesnt work properly. The page is zoomed out (view from like a desktop browser) and zooming is disabled. Without the code, the page scales perfectly right from an 50" tv to the smallest nokia on the planet. Am I doing something wrong? Im starting to think the problem is caused by the body/content somehow being over 100% of the viewport. No idea how though.

    Read the article

  • UITextField inside of UITableViewCell will not activate on iPad but works on iPhone

    - by cfihelp
    I have a UITextField inside a UITableViewCell. It will not activate on the iPad (but it works fine on the iPhone) no matter what I try. Tapping on it and telling it to become the firstResponder both fail. The odd thing is that if I take the exact same code and move it to another view controller in my app it executes just fine. This makes it seem as if there is likely a problem in the parent UITableViewController but I can't find anything obvious. I'm hoping that someone out there has experienced a similar problem and can point me in the right direction. Below is the sample code that works fine when I move it to a new project or put it in a new view controller launched immediately by my app delegate: // Customize the appearance of table view cells. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease]; } if (indexPath.row == 0) { UITextField *nameText = [[UITextField alloc] initWithFrame:CGRectMake(5, 5, cell.contentView.frame.size.width, cell.contentView.frame.size.height)]; nameText.delegate = self; nameText.backgroundColor = [UIColor redColor]; [cell.contentView addSubview:nameText]; [nameText becomeFirstResponder]; [nameText release]; } // Configure the cell... return cell; } Help!

    Read the article

  • Safari openwindow function behavior on iPad versus iPhone

    - by CodeLizard
    An identical javascript:openwindow call with a link to Google maps opens in Safari on the iPad but in the Google Maps App on the iPhone. Why the difference? <html> <head> </head> <body> <a title="View an area map for this property" href="javascript:openwindow ('http://maps.google.com/maps?f=q&source=s_q&hl=en&geocode=&q=1+Infinite+Loop, +Cupertino,+CA%E2%80%8E&sll=37.329389, -122.029696&sspn=0.015714,0.033023&ie=UTF8&hq=&hnear=1+Infinite+Loop, +Cupertino,+Santa+Clara, +California+95014&ll=37.331539, -122.030704&spn=0.007857,0.016512&z=17&ssa=1', 760, 500,'yes', 'yes')"> <font face="arial,helvetica" color="#000000" size="-1">Map It</font> </a> </body> <script> function openwindow(url,width,height,resizable,scrollbars,posx,posy) { if(posx==null)posx=20; if(posy==null)posy=20; now=new Date(); var x_offset=0; var y_offset=0; try { if(window.screen.left != undefined && window.screen.top != undefined) { x_offset=window.screen.left; y_offset=window.screen.top; } }catch(e){} var window_x=posx+x_offset; var window_y=posy+y_offset; new_window=window.open(url,now.getTime(),'width='+width+',height='+height+', resizable='+resizable+',scrollbars='+scrollbars+',top='+window_y+', left='+window_x+',screenX='+window_x+',screenY='+window_y); if(!new_window.opener) new_window.opener=self; try { new_window.focus(); }catch(e){} } </script> </html>

    Read the article

  • iPhone: Cell imageViews repeating when loaded from url

    - by araid
    I'm developing a demo RSS reader for iPhone. I obviously have a tableview to display the feeds, and then a detailed view. Some of this feeds have a thumbnail that I want to display on cell.imageview of the table, and some don't. The problem is that when scrolling the table, loaded thumbnails start repeating on other cells, and I end up with a thumbnail on every cell. Here's a piece of my code. I may upload screenshots later - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ UITableViewCell * cell = [tableView dequeueReusableCellWithIdentifier: @"rssItemCell"]; if(nil == cell){ cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:@"rssItemCell"]autorelease]; } BlogRss *item = [[[self rssParser]rssItems]objectAtIndex:indexPath.row]; cell.textLabel.text = [item title]; cell.detailTextLabel.text = [item description]; cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; // Thumbnail if exists if(noticia.imagePath != nil){ NSData* imageData; @try { imageData = [[NSData alloc]initWithContentsOfURL:[NSURL URLWithString:item.imagePath]]; } @catch (NSException * e) { //Some error while downloading data } @finally { item.image = [[UIImage alloc] initWithData:imageData]; [imageData release]; } } if(item.image != nil){ [[cell imageView] setImage:item.image]; } return cell; } Any help will be very appreciated.

    Read the article

  • iPhone Twitter Integration: Validating login.

    - by Mr. McPepperNuts
    The following code posts to twitter: NSString *compoundLoginString = [NSString stringWithFormat:@"http://%@:%@@twitter.com/statuses/update.xml",extractedUsername, extractedPassword]; NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL: [NSURL URLWithString:compoundLoginString] cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:20.0]; // The text to post NSString *msg = tweetText; [request setHTTPMethod:@"POST"]; [request setHTTPBody:[[NSString stringWithFormat:@"status=%@", msg] dataUsingEncoding:NSASCIIStringEncoding]]; NSURLResponse *response; NSError *error; if ([NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&error] != nil){ [self postSuccessfulAlert]; }else{ [self postNotSuccessfulAlert]; } I am curious as to how I could check if the username and password is correct before proceeding to the above piece of code. I found the following code in a tutorial, but am unsure how I would implement or call this function. - (void)connection:(NSURLConnection *)connection didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge { if ([challenge previousFailureCount] == 0) { NSURLCredential *newCredential; newCredential=[NSURLCredential credentialWithUser:[self username] password:[self password] persistence:NSURLCredentialPersistenceNone]; [[challenge sender] useCredential:newCredential forAuthenticationChallenge:challenge]; } else { [[challenge sender] cancelAuthenticationChallenge:challenge]; // inform the user that the user name and password // in the preferences are incorrect NSLog(@"Invalid Username or Password"); } } Any ideas? Please note, I have taken snippets of code from both of the following tutorials. http://iphonedevelopertips.com/networking/post-to-a-twitter-account-from-the-iphone.html and http://icodeblog.com/2009/07/09/integrating-twitter-into-your-applications/

    Read the article

  • iPhone UI layout debugging

    - by Cruinh
    I have this chronic issue with iPhone UI development where views sometimes seem to appear on the screen in a location different than what is reported by their frame property. Here is what I am doing to try to debug the issue: UIView *currentView = self.view; while (currentView!=nil) { NSLog(@"frame: %f,%f,%f,%f", currentView.frame.origin.x, currentView.frame.origin.y, currentView.frame.size.width, currentView.frame.size.height); currentView = currentView.superview; } I expect this should show me the coordinates and size of each element up the hierarchy from the given view to the app's root UIWindow element, with the coordinates for each element relative to its parent. However, that does not seem to be the case. In my current situation, I have a UI I'm trying to debug where every other time I rotate the device, the whole UI shifts up or down 20 pixels, yet the code block above reports exactly the same numbers every time. I tried calling the above code after as much as a second delay, but that the numbers still come out the same each time. Does anyone know a better way to inspect the screen coordinates of UI elements? If I can detect when one is wrong, I can compensate for the problem when it appears.

    Read the article

  • iPhone Core Data problem

    - by Junior B.
    This is my first project with Core Data, I followed the Event tutorial provided by Apple that helped me to understand the basic of core data in iPhone. But now, working over my project, I've a problem adding data into my database. When i create an object and set the data, if I try to get it back, the system returns me a strange sequence of characters. This is what i see in log if I try to log it: 2010-05-11 00:16:43.523 FG[2665:207] Package: ‡}00å 2010-05-11 00:16:43.525 FG[2665:207] Package: ‡}00å 2010-05-11 00:16:43.526 FG[2665:207] Package: ‡}00å 2010-05-11 00:16:43.527 FG[2665:207] Package: ‡}00å 2010-05-11 00:16:43.527 FG[2665:207] Package: ‡}00å 2010-05-11 00:16:43.527 FG[2665:207] Items: 5 What kind of problem could be this? Edit: This is the part of the code that generate the error: package = (Package *)[NSEntityDescription insertNewObjectForEntityForName:@"Package" inManagedObjectContext:moc]; theNodes = [doc nodesForXPath:@"//pack" error:&error]; for (CXMLElement *theElement in theNodes) { // Create a counter variable as type "int" int counter; // Loop through the children of the current node for(counter = 0; counter < [theElement childCount]; counter++) { if([[[theElement childAtIndex:counter] name] isEqualToString: @"id"]) [package setIdPackage:[[theElement childAtIndex:counter] stringValue]]; if([[[theElement childAtIndex:counter] name] isEqualToString: @"title"]) [package setPackageTitle:[[theElement childAtIndex:counter] stringValue]]; if([[[theElement childAtIndex:counter] name] isEqualToString: @"category"]) [package setCategory:[[theElement childAtIndex:counter] stringValue]]; if([[[theElement childAtIndex:counter] name] isEqualToString: @"lang"]) [package setLang:[[theElement childAtIndex:counter] stringValue]]; if([[[theElement childAtIndex:counter] name] isEqualToString: @"number"]) { NSNumberFormatter * f = [[NSNumberFormatter alloc] init]; [f setNumberStyle:NSNumberFormatterDecimalStyle]; NSNumber * myNumber = [f numberFromString:[[theElement childAtIndex:counter] stringValue]]; [f release]; [package setNumber:myNumber]; } } } NSLog([NSString stringWithFormat:@"=== %s ===\nID: %s\nCategory: %s\nLanguage: %s",[package packageTitle], [package idPackage] ,[package category],[package lang]]);

    Read the article

< Previous Page | 143 144 145 146 147 148 149 150 151 152 153 154  | Next Page >