Search Results

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

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

  • Using HTML5 on iPhone - cannot pause

    - by Ariel
    Hey guys, I was wondering whether anyone has tried to use the new tag that comes with HTML5 on the iPhone. Specifically, I didn't manage to make the pause() command to work. Below is a portion of the page. As you can see, I'm trying to pause the video 10sec after it started. It works on Safari on a Mac btw. Has anyone managed to make this work? <head> <javascript language="JavaScript"> function timeUpdate() { var myVideo = document.getElementsByTagName('video')[0]; var time = myVideo.currentTime; if (time > 10) { myVideo.pause(); } } function addListeners() { var myVideo = document.getElementsByTagName('video')[0]; myVideo.addEventListener('timeupdate',timeUpdate,false); } </script> </head> <body onload="addListeners()"> <video controls src="resources/bb_poor_cinderella_512kb.mp4" poster="resources/background.png"> Video tag not supported! </video> </body> Thanks, Ariel

    Read the article

  • Drawing only part of a texture OpenGL ES iPhone

    - by Ben Reeves
    ..Continued on from my previous question I have a 320*480 RGB565 framebuffer which I wish to draw using OpenGL ES 1.0 on the iPhone. - (void)setupView { glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_CROP_RECT_OES, (int[4]){0, 0, 480, 320}); glEnable(GL_TEXTURE_2D); } // Updates the OpenGL view when the timer fires - (void)drawView { // Make sure that you are drawing to the current context [EAGLContext setCurrentContext:context]; //Get the 320*480 buffer const int8_t * frameBuf = [source getNextBuffer]; //Create enough storage for a 512x512 power of 2 texture int8_t lBuf[2*512*512]; memcpy (lBuf, frameBuf, 320*480*2); //Upload the texture glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 512, 512, 0, GL_RGB, GL_UNSIGNED_SHORT_5_6_5, lBuf); //Draw it glDrawTexiOES(0, 0, 1, 480, 320); [context presentRenderbuffer:GL_RENDERBUFFER_OES]; } If I produce the original texture in 512*512 the output is cropped incorrectly but other than that looks fine. However using the require output size of 320*480 everything is distorted and messed up. I'm pretty sure it's the way I'm copying the framebuffer into the new 512*512 buffer. I have tried this routine int8_t lBuf[512][512][2]; const char * frameDataP = frameData; for (int ii = 0; ii < 480; ++ii) { memcpy(lBuf[ii], frameDataP, 320); frameDataP += 320; } Which is better, but the width appears to be stretched and the height is messed up. Any help appreciated.

    Read the article

  • Socket Communication in iPhone

    - by Timmi
    I have many images in iPhone. I have to send this images to server using a socket communication. what all we need to do to send the images to server through socket. If i use this code i can send string. what all should i change in the code so that i can send image through socket. I am new to network programming so some please help me to find a solution CFWriteStreamRef writeStream = NULL; CFStringRef host = CFSTR("192.168.1.211"); UInt32 port = 8001; CFStreamCreatePairWithSocketToHost(kCFAllocatorDef ault, host, port, NULL, &writeStream); CFWriteStreamSetProperty(writeStream, kCFStreamPropertyShouldCloseNativeSocket, kCFBooleanTrue); if(!CFWriteStreamOpen(writeStream)) { NSLog(@"Error Opening Socket"); } else{ UInt8 buf[] = "Hi !!!"; int bytesWritten = CFWriteStreamWrite(writeStream, buf, strlen((char*)buf)); NSLog(@"Written: %d", bytesWritten); if (bytesWritten < 0) { CFStreamError error = CFWriteStreamGetError(writeStream); } } Thanks,

    Read the article

  • [iphone,twitter] Accessing the Twitter API through a proxy using NSURLConnectionsm, OAuth problem

    - by akaii
    I'm having no problems with sending an update directly via hxxps://api.twitter.com/, but the app (for the Iphone, I'm using NSURLConnections) I'm working is supposed to allow the user to select a preferred proxy (e.g. hxxps://twitter-proxy.appspot.com/api/ or hxxps://nest.onedd.net/api/), and I keep getting a 401 error (Failed to validate oauth signature and token) whenever I try to get an access token via these proxies. Even though I send my POST request to the proxy, I am still using the direct url for the api (https:// api.twitter.com/[rest api path]) in the base string. Despite the 401 error message above, the status code I'm actually getting from connection:didReceiveResponse: is 200, probably because it was able to successfully contact the proxy... Is there anything else that I need to consider when using a proxy to access the API? Should anything in the authorization header change, for example? Or the base string? I can manage to connect via Basic Auth without issue, but support for that will be dropped in a month. On a somewhat unrelated note... What are the possible causes of Twitter's error 403, and how do you distinguish between them? Is the only way to differentiate an error due to exceeding the status update limit for an hour (150 per hour) vs for a day (1000 per day) by checking the string reply returned in the response? Is there any way for me to simulate a status update limit error without going through the motions of actually sending 150/1000 tweets?

    Read the article

  • My 3D object (opengl es) is disappearing behind the iPhone camera view

    - by KLC
    I have an augmented reality iPhone app that I am converting from Core Animation to OpenGL ES 1.1. I have added code that has been modified from the Apple OpenGL template. My problem is that my 3D object , when translating along the negative Z-axis (away from the user), appears to disappear into the camera view, until its completely gone. I have experimented with several solutions, but to no avail. What I have determined: Using the 3D icosahedron from Jeff Lamarche's blog here, the object starts it at 0,0,0 and then translates with decreasing z coordinates. By the time the z value reaches -2.0f, the object is gone. It appears as if it is disappearing behind the camera view. This is how I set my frustrum & viewport (unchanged from Apple's code) glMatrixMode(GL_PROJECTION); size = zNear * tanf(DEGREES_TO_RADIANS(fieldOfView) / 2.0); //Grab the size of the screen CGRect rect = self.bounds; glFrustumf(-size, size, -size / (rect.size.width / rect.size.height), size / (rect.size.width / rect.size.height), zNear, zFar); glViewport(0, 0, rect.size.width, rect.size.height); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); What I have tried: The camera view is the main view and several other views are added to it as subviews, including the openGLView. I have commented those views out for test purposes. I have applied CATransforms to move the openGLView in the z direction -500 and +500, and done the same to the camera view. I have also changed the zFar in the above code to 1.0f, and it still disappears at z position of -2.0, which doesn't make sense (shouldn't it disappear at z=1.0?) My experimentation has got me more confused than when I started ( which usually means I am missing a key piece, but I can't figure out what). Thanks for your help.

    Read the article

  • working with large sprite sheets on iphone

    - by lukya
    Hi All, I am trying to use sprite sheet animation in my application. The first POC with a small sprite sheet worked fine but as i change the sprite sheet to a bigger one, i get "check_safe_call: could not restore current frame" warning and the application quits. A quick search revealed that this problem meant my app is taking too much memory or the image is too huge in dimension. My image is 4.9 Mb and dimensions are 6720 * 10080 (oops!!). i read that iphone allows maximum 3 Mb image with dimensions up to 1024 * 1024. Also that the sprite sheet image dimensions should be a power of two. So please let me know how i can use a sprite sheet this big. One approach could be to cut the sprite sheet into many smaller sprite sheets and use them one at a time. Please suggest if you know any other/better approach to accommodate bigger sprite sheets and whether the problem with my sprite sheet is size (4.9 Mb) OR dimensions (6720 * 10080). (Just FYI, i am not trying to play a movie so using MP4 file instead is not an option for me. i need to animate the sprite sheet based on accelerometer input and i have been able to achieve that in my POC with smaller sprite sheet.) Thanks, Swapnil

    Read the article

  • Porting WebGL game to iPhone's native OpenGL?

    - by ArtPulse
    We are developing a web game that uses WebGL for the two biggest parts of it. Working with HTML / CSS was too slow and too limited, so it's off the table. Thing is, iOS does not support WebGL publicly just yet, only on iAd. It is my guess Apple will eventually support it once the security issues they and Microsoft claim it has are fixed, and looks stable enough. Problem is, if Apple does not do this by the release of the next mayor iOS version, then we will have in our hands a mobile WebGL game that does not run. 6 months of development and testing to waste. So, questions: If that was the case, how viable (regarding amount of time) is it porting the WebGL part of the game to native iPhone OpenGL? I'm afraid that porting will take longer than the development of the game itself. I saw posts on Stack Overflow (like this) that suggested, on Android, adding the OpenGL interface manually to a WebKit element. It'd be slower than native. But either way... Is this something that could be accepted in the AppStore? Apple is very restrictive with these kind of stuff... Thank you all for your time!

    Read the article

  • iphone crash log with dSym not loading debug information

    - by AngeDeLaMort
    Hello, I was trying to see why my application crashed on the device (iPhone) using the dSym generated along the executable (in ad hoc), but I don't know why, there isn't any useful information. It seems that "Organizer" is able to find the appropriate dSym and translate some data into more readable one, but when it comes to my application, I just have an address. Since I know how to reproduce it, I've tried to setup my build so it can help me in the future. So, I've tried to find if I had all the proper flags set int the project build properties and everything seems fine. So after doing some research, it seems that all information are stripped during link time and the dSym seems completely useless. I've played with some flags, but nothing changed. So, is there something special to do in order to get the crash file human readable? Or is it impossible in the ad hoc setting? The closest thing near to work that I've done was to build a debug version and look up the address in it. At least it seems to give the right file. So, I made a sample app and here what I have: (the line I want is #4): Thread 0 Crashed: 0 libobjc.A.dylib 0x00003ebc objc_msgSend + 20 1 UIKit 0x0005c970 -[UIView dealloc] + 60 2 UIKit 0x0005c840 -[UIImageView dealloc] + 76 3 CoreFoundation 0x0003963a -[NSObject release] + 28 4 MyApplication 0x000046a6 0x1000 + 13990 5 UIKit 0x00069750 -[UIViewController view] + 44 6 MyApplication 0x000053fa 0x1000 + 17402 The crash is made using 2 successive releases on an object. Thanks in advance.

    Read the article

  • iPhone View Switching basics.

    - by Daniel Granger
    I am just trying to get my head around simple view switching for the iPhone and have created a simple app to try and help me understand it. I have included the code from my root controller used to switch the views. My app has a single toolbar with three buttons on it each linking to one view. Here is my code to do this but I think there most be a more efficient way to achieve this? Is there a way to find out / remove the current displayed view instead of having to do the if statements to see if either has a superclass? I know I could use a tab bar to create a similar effect but I am just using this method to help me practice a few of the techniques. -(IBAction)switchToDataInput:(id)sender{ if (self.dataInputVC.view.superview == nil) { if (dataInputVC == nil) { dataInputVC = [[DataInputViewController alloc] initWithNibName:@"DataInput" bundle:nil]; } if (self.UIElementsVC.view.superview != nil) { [UIElementsVC.view removeFromSuperview]; } else if (self.totalsVC.view.superview != nil) { [totalsVC.view removeFromSuperview]; } [self.view insertSubview:dataInputVC.view atIndex:0]; } } -(IBAction)switchToUIElements:(id)sender{ if (self.UIElementsVC.view.superview == nil) { if (UIElementsVC == nil) { UIElementsVC = [[UIElementsViewController alloc] initWithNibName:@"UIElements" bundle:nil]; } if (self.dataInputVC.view.superview != nil) { [dataInputVC.view removeFromSuperview]; } else if (self.totalsVC.view.superview != nil) { [totalsVC.view removeFromSuperview]; } [self.view insertSubview:UIElementsVC.view atIndex:0]; } } -(IBAction)switchToTotals:(id)sender{ if (self.totalsVC.view.superview == nil) { if (totalsVC == nil) { totalsVC = [[TotalsViewController alloc] initWithNibName:@"Totals" bundle:nil]; } if (self.dataInputVC.view.superview != nil) { [dataInputVC.view removeFromSuperview]; } else if (self.UIElementsVC.view.superview != nil) { [UIElementsVC.view removeFromSuperview]; } [self.view insertSubview:totalsVC.view atIndex:0]; } }

    Read the article

  • ZipArchive on the iPhone unzips files but they are empty

    - by user345131
    I'm trying to use ZipArchive on the iPhone to unzip a simple text file. It returns with no error but the file is empty. I would love to know why this doesn't work. I am using the following methods: -(void)alert:(NSString*)message { UIAlertView *myAlert = [[UIAlertView alloc] initWithTitle:@"" message:message delegate:self cancelButtonTitle:@"Ok" otherButtonTitles:nil, nil]; [myAlert show]; [myAlert release]; } -(void)unzip { NSString *sourcepath = [[NSBundle mainBundle] pathForResource:@"secret" ofType:@"zip"]; NSString*filename = @"secret.txt"; NSArray *docPaths =NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask, YES); NSString *destinationpath = [docPaths objectAtIndex: 0]; if (filename != nil ) destinationpath = [destinationpath stringByAppendingPathComponent: filename]; ZipArchive* za = [[ZipArchive alloc] init]; if( [za UnzipOpenFile:sourcepath Password:@""] ) { BOOL ret = [za UnzipFileTo:destinationpath overWrite:YES]; if( NO==ret ) [self alert:@"Problem"]; else [self alert:@"Success"]; [za UnzipCloseFile]; } [za release]; NSString *test = [[NSString alloc] initWithContentsOfFile:destinationpath encoding:NSASCIIStringEncoding error:nil]; [self alert:test]; }

    Read the article

  • iphone - moving from one view to another

    - by codemonkey
    Hi there, I am getting started with iphone development and am trying to move from one view to another. I have a main view (NearestPhotosViewController) which basically acts as a menu for my app. I then have a second view (DisplayNearestPhotos). I come from a web (html) background so what i'm trying to do here in web terms is click a button (link) on the NearestPhotosViewController view to then display the DisplayNearestPhotos view. I have been looking around for some code to do this (I don't think it's as simple as doing the equivelent in html). The following code is hooked up to a button on my menu view. -(IBAction)ButtonPressed:(id)sender { DisplayNearestPhotos *views = [[DisplayNearestPhotos alloc] initWithNibName:nil bundle:nil]; [self presentModalViewController:views animated:YES]; views.release; } The above code works (it displays the second view) but what i'd like to know is, is that the correct way to do it? If not, what is the correct way to move from one view to another? Thank you in advance

    Read the article

  • Trouble when changing pixel data with alpha on png on iphone --okay on simulator

    - by Ted
    I'm trying to change the color of the pixels (lighten or darken) without changing the value of the alpha channel using CGDataProviderCopyData. I leave every 4th databyte untouched. It work fine of the iphone simulator, however on the real thing the alpha goes white as I increase the values of the other pixels. I've tried changing just the first byte, or the second, or the third. Does anybody have any idea what is going on? The basic code is borrowed from Jorge. I like this simple approach --I'm new to this. But I want to make it work with png images with some transparency. here is most of the code by Jorge : CFDataRef CopyImagePixels(CGImageRef inImage){ return CGDataProviderCopyData(CGImageGetDataProvider(inImage)); } CGImageRef img=originalImage.CGImage; CFDataRef dataref=CopyImagePixels(img); UInt8 *data=(UInt8 *)CFDataGetBytePtr(dataref); int length=CFDataGetLength(dataref); for(int index=0;index255){ data[index+i]=255; }else{ data[index+i]+=value; } } } } size_t width=CGImageGetWidth(img); size_t height=CGImageGetHeight(img); size_t bitsPerComponent=CGImageGetBitsPerComponent(img); size_t bitsPerPixel=CGImageGetBitsPerPixel(img); size_t bytesPerRow=CGImageGetBytesPerRow(img); CGColorSpaceRef colorspace=CGImageGetColorSpace(img); CGBitmapInfo bitmapInfo=CGImageGetBitmapInfo(img); CGImageAlphaInfo alphaInfo = kCGBitmapAlphaInfoMask(img); NSLog(@"bitmapinfo: %d",bitmapInfo); CFDataRef newData=CFDataCreate(NULL,data,length); CGDataProviderRef provider=CGDataProviderCreateWithCFData(newData); CGImageRef newImg=CGImageCreate(width,height,bitsPerComponent,bitsPerPixel,bytesPerRow,colorspace,bitmapInfo,provider,NULL,true,kCGRenderingIntentDefault); [iv setImage:[UIImage imageWithCGImage:newImg]]; CGImageRelease(newImg); CGDataProviderRelease(provider);

    Read the article

  • iPhone NSCFString leaks in fetchRequest

    - by camilo
    In the following code: - (NSMutableArray *) fetchNotesForGroup: (NSString *)groupName { // Variables declaration NSMutableArray *result; NSFetchRequest *fetchRequest; NSEntityDescription *entity; NSSortDescriptor *sortDescriptor; NSPredicate *searchPredicate; NSError *error = nil; // Creates the fetchRequest and executes it fetchRequest = [[[NSFetchRequest alloc] init] autorelease]; entity = [NSEntityDescription entityForName:@"Note" inManagedObjectContext:managedObjectContext]; [fetchRequest setEntity:entity]; sortDescriptor = [[[NSSortDescriptor alloc] initWithKey:@"noteName" ascending:YES] autorelease]; [fetchRequest setSortDescriptors:[NSArray arrayWithObject:sortDescriptor]]; [fetchRequest setReturnsDistinctResults:YES]; searchPredicate = [NSPredicate predicateWithFormat:@"categoryName like %@", groupName]; [fetchRequest setPredicate:searchPredicate]; [fetchRequest setPropertiesToFetch:[NSArray arrayWithObject:@"noteName"]]; result = [[managedObjectContext executeFetchRequest:fetchRequest error:&error] mutableCopy]; // Variables release return result; } ... I Fetch notes for a given categoryName. When I'm running Instruments, it says that a NSCFString is leaking. I know leaks are mean for iPhone developers... but I don't have any idea on how to plug this one. Any clues? All help is welcome. Thanks a lot!

    Read the article

  • Inheritance issue with ivar on the iPhone

    - by Buffalo
    I am using the BLIP/MYNetwork library to establish a basic tcp socket connection between the iPhone and my computer. So far, the code builds and runs correctly in simulator but deploying to device yields the following error: error: property 'delegate' attempting to use ivar '_delegate' declared in super class of 'TCPConnection' @interface TCPConnection : TCPEndpoint { @private TCPListener *_server; IPAddress *_address; BOOL _isIncoming, _checkedPeerCert; TCPConnectionStatus _status; TCPReader *_reader; TCPWriter *_writer; NSError *_error; NSTimeInterval _openTimeout; } /** The delegate object that will be called when the connection opens, closes or receives messages. */ @property (assign) id<TCPConnectionDelegate> delegate; /** The delegate messages sent by TCPConnection. All methods are optional. */ @protocol TCPConnectionDelegate <NSObject> @optional /** Called after the connection successfully opens. */ - (void) connectionDidOpen: (TCPConnection*)connection; /** Called after the connection fails to open due to an error. */ - (void) connection: (TCPConnection*)connection failedToOpen: (NSError*)error; /** Called when the identity of the peer is known, if using an SSL connection and the SSL settings say to check the peer's certificate. This happens, if at all, after the -connectionDidOpen: call. */ - (BOOL) connection: (TCPConnection*)connection authorizeSSLPeer: (SecCertificateRef)peerCert; /** Called after the connection closes. You can check the connection's error property to see if it was normal or abnormal. */ - (void) connectionDidClose: (TCPConnection*)connection; @end @interface TCPEndpoint : NSObject { NSMutableDictionary *_sslProperties; id _delegate; } - (void) tellDelegate: (SEL)selector withObject: (id)param; @end Does anyone know how I would fix this? Would I simply declare _delegate as a public property of the base class "TCPEndPoint"? Thanks for the help ya'll!

    Read the article

  • iphone encode problem with ffmpeg

    - by samantha
    Hi, I need to encode a video from image. I use ffmpeg and compiling rigth. My problem is that when i try to opne video with quicktime on iphone, this give me a message "this movie format is not supported". I create a file mp4 with this parameter on context: context-time_base.num = 1; context-time_base.den = 15; context-codec_type = CODEC_TYPE_VIDEO; context-codec_id = CODEC_ID_H264; context-bit_rate = 1000000; context-width = width; context-height = height; context-keyint_min = 10; context-i_quant_factor = 0.71; context-bit_rate_tolerance = 20000; context-rc_max_rate = 100000; context-rc_buffer_size = 8835000; context-qcompress = 0.6; context-qmin = 10; context-qmax = 30; context-max_qdiff = 4; context-gop_size = 30; context->time_base.num = 1; context-time_base.den = 30; context-sample_aspect_ratio = av_d2q(1, 255); context-profile = 30; context-pix_fmt = PIX_FMT_YUV420P; context-flags |= CODEC_FLAG_LOOP_FILTER; where is my mistake?? thanks

    Read the article

  • NSUserDefaults: Saved Number Always 0, iPhone

    - by Stumf
    Hello all, I have looked at other answers and the docs. Maybe I am missing something, or maybe I have another issue. I am trying to save a number on exiting the app, and then when the app is loaded I want to check if this value exists and take action accordingly. This is what I have tried: To save on exiting: - (void)applicationWillTerminate: (UIApplication *) application { double save = [label.text doubleValue]; [[NSUserDefaults standardUserDefaults] setDouble: save forKey: @"savedNumber"]; [[NSUserDefaults standardUserDefaults] synchronize]; } To check: - (IBAction)buttonclickSkip{ double save = [[NSUserDefaults standardUserDefaults] doubleForKey: @"savedNumber"]; if (save == 0) { [self performSelector:@selector(displayAlert) withObject:nil]; test.enabled = YES; test.alpha = 1.0; skip.enabled = NO; skip.alpha = 0.0; } else { label.text = [NSString stringWithFormat:@"%.1f %%", save]; } } The problem is I always get my alert message displayed, the saved value is not put into the label so somehow == 0 is always true. If it makes any difference I am testing this on the iPhone simulator. Many thanks, Stu

    Read the article

  • Predicate crashing iPhone App!

    - by DVG
    To preface, this is a follow up to an inquiry made a few days ago: http://stackoverflow.com/questions/2981803/iphone-app-crashes-when-merging-managed-object-contexts Short Version: EXC_BAD_ACCESS is crashing my app, and zombie-mode revealed the culprit to be my predicate embedded within the fetch request embedded in my Fetched Results Controller. How does an object within an object get released without an explicit command to do so? Long Version: Application Structure Platforms View Controller - Games View Controller (Predicated upon platform selection) - Add Game View Controller When a row gets clicked on the Platforms view, it sets an instance variable in Games View for that platform, then the Games Fetched Results Controller builds a fetch request in the normal way: - (NSFetchedResultsController *)fetchedResultsController{ if (fetchedResultsController != nil) { return fetchedResultsController; } //build the fetch request for Games NSFetchRequest *request = [[NSFetchRequest alloc] init]; NSEntityDescription *entity = [NSEntityDescription entityForName:@"Game" inManagedObjectContext:context]; [request setEntity:entity]; //predicate NSPredicate *predicate = [NSPredicate predicateWithFormat:@"platform == %@", selectedPlatform]; [request setPredicate:predicate]; //sort based on name NSSortDescriptor *sortDescriptor = [[NSSortDescriptor alloc] initWithKey:@"name" ascending:YES]; NSArray *sortDescriptors = [[NSArray alloc] initWithObjects:sortDescriptor, nil]; [request setSortDescriptors:sortDescriptors]; //fetch and build fetched results controller NSFetchedResultsController *aFetchedResultsController = [[NSFetchedResultsController alloc] initWithFetchRequest:request managedObjectContext:context sectionNameKeyPath:nil cacheName:@"Root"]; aFetchedResultsController.delegate = self; self.fetchedResultsController = aFetchedResultsController; [sortDescriptor release]; [sortDescriptors release]; [predicate release]; [request release]; [aFetchedResultsController release]; return fetchedResultsController; } At the end of this method, the fetchedResultsController's _fetch_request - _predicate member is set to an NSComparisonPredicate object. All is well in the world. By the time - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section gets called, the _predicate is now a Zombie, which will eventually crash the application when the table attempts to update itself. I'm more or less flummoxed. I'm not releasing the fetched results controller or any of it's parts, and the only part getting dealloc'd is the predicate. Any ideas?

    Read the article

  • Website does not automatically fit to iphone screen

    - by Ploetzeneder
    Hello, The following code does not fit onto the iphone screen; how do I have to define the viewport? <html> <body> <center> <div id="karteu" style="background: url('../customer/Karten/karte1.jpg') no-repeat left center;width:714px;height:540px;" > </div> </body> </html> Normally the site should be zoomed, so i first should see the website in small, and then be able to zoom that i see it in the original size, but in my case it does not, when i call the site, the zoom is, that the image has this original size already, and that i have to scroll, but i dont want to scroll,...i want to use the normal safari mobile zoom and then scroll The solution at the bottom does not zoom anything. I want to see the overview of the image at the beginning. Then i want to be able to zoom with the normal safari zoom functions,..

    Read the article

  • Animation is slow on iPhone

    - by Anthony Chan
    I'm developing an app that would display images and change them according to the user's action. I've created a subclass of UIView to contain an image, an index number and an array of image names. The code is like this: @interface CustomPic : UIView { UIImageView *pic; NSInteger index; NSMutableArray *picNames; //<-- an array of NSString } And in the implementation part, it has a method to change the image using a dissolve effect. - (void)nextPic { index++; if (index >= [picNames count]) { index = 0; } UIImageView *temp = pic; pic.image = [UIImage imageNamed:[picNames objectAtIndex:index]]; temp.alpha = 0; [UIView beginAnimations:nil context:nil]; [UIView setAnimationCurve:UIViewAnimationCurveEaseOut]; [UIView setAnimationDuration:0.25]; pic.alpha = 0; temp.alpha = 1; [UIView commitAnimations]; } In the viewController, there are several CustomPic which would change the images depends on users' choice. The images would change as expected with the fade in/out effect, but the animation performance is really bad. I've tested it on an iPhone 3G, the Instruments shows that the animation is only 2-3FPS! I tried many methods to simplify and modify the codes but with no hope. Is there something wrong in my code or in my concept? Thanks for any help. P.S. all the images are 320*480 PNGs with a max size of 15KB.

    Read the article

  • Preserve HTML font-size when iPhone orientation changes from portrait to landscape

    - by DShultz
    I have a mobile web application with an unordered list containing multiple listitems with a hyperlink inside of each li: <ul> <li id="home" class="active"> <a href="home.html">HOME</a></div> </li> <li id="home" class="active"> <a href="test.html">TEST</a></div> </li> </ul> ...My question is how can I format the hyperlinks so that they DON'T change size when viewed on an iPhone, and the accellerometer switches from portrait - landscape? Right now, I have the hyperlink font size spec'ed to 14px, but when switching to landscape, it blows way up to like 20px. I want the font-size to stay the same. Here is the selector: ul li a { font-size:14px; text-decoration: none; color: #cc9999; }

    Read the article

  • Pre-populate iPhone Safari SQLite DB

    - by Matt Rogish
    I'm working with a PhoneGap app that uses Safari local storage (SQlite DB) via Javascript: http://developer.apple.com/safari/library/documentation/iPhone/Conceptual/SafariJSDatabaseGuide/UsingtheJavascriptDatabase/UsingtheJavascriptDatabase.html On first load, the app creates the database, tables, and populates the data via a series of INSERT statements. If the user closes the app while this processing is happening, then my app database is left in an inconsistent state. What I prefer to do is deploy the SQLite DB as part of my iTunes App packaging so nothing must be populated at app cold start. However, I'm not sure if that is possible -- all of the google hits for this topic that I can find are referring to the core-data provided SQLite which is not what we're using... If it's not possible, could I wrap the entire thing in a transaction and keep re-trying it when the app is restarted? Failing that, I guess I can create a simple table with one boolean column "is_app_db_loaded?" and set it to true after I've processed all my inserts. But that's really gross... Ideas? Thanks!!

    Read the article

  • How to parse the second child node from xml page in iphone

    - by Warrior
    I am new to iphone development.I want parse an you-tube XML page and retrieve its contents and display in a RSS feed. my xml page is <entry> <id>xxxxx</id> <title>xxx xxxx xxxx</title> <content>xxxxxxxxxxx</content> <media:group> <media:thumbnail url="http://tiger.jpg"/> </media:group> </entry> To retrieve the content i am using xml parsing. - (void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName attributes:(NSDictionary *)attributeDict{ currentElement = [elementName copy]; if ([elementName isEqualToString:@"entry"]) { entry = [[NSMutableDictionary alloc] init]; currentTitle = [[NSMutableString alloc] init]; currentcontent = [[NSMutableString alloc] init]; } } - (void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName{ if ([elementName isEqualToString:@"entry"]) { [entry setObject:currentTitle forKey:@"title"]; [entry setObject:currentDate forKey:@"content"]; [stories addObject:[entry copy]]; }} - (void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string{ if ([currentElement isEqualToString:@"title"]) { [currentTitle appendString:string]; } else if ([currentElement isEqualToString:@"content"]) { [currentLink appendString:string]; } } I am able to retrieve id , title and content value and display it in a table-view.How can i retrieve tiger image URL and display it in table-view.Please help me out.Thanks.

    Read the article

  • EXC_BAD_ACCESS with NSUserdefaults on iphone.

    - by Andreas Johannessen
    I have the following code in my ApplicationDelegate. My deployment target is 3.0 and upwards, however I get a EXC_BAD_ACCESS when I launch the app with the following code on my iPhone with 3.1.3, however on the simulator which has 4.2 it runs fine. I would really appriciate help on this one, thanks in advance. When I comment this block when I deploy to 3.1.3 device it runs without bad access. + (void)initialize { NSString *path = [[NSBundle mainBundle] bundlePath]; NSString *pListPath = [path stringByAppendingPathComponent:@"Settings.bundle/Root.plist"]; NSDictionary *pList = [NSDictionary dictionaryWithContentsOfFile:pListPath]; NSMutableArray *prefsArray = [pList objectForKey:@"PreferenceSpecifiers"]; NSMutableDictionary *regDictionary = [NSMutableDictionary dictionary]; for (NSDictionary *dict in prefsArray) { NSString *key = [dict objectForKey:@"Key"]; if(key) { id value = [dict objectForKey:@"DefaultValue"]; [regDictionary setObject:value forKey:key]; } } [[NSUserDefaults standardUserDefaults] registerDefaults:regDictionary]; } UPDATE: I traced the error to happen on this line: [[NSUserDefaults standardUserDefaults] registerDefaults:regDictionary]; So there is probaly another syntax on earlier iOS, or am I wrong?

    Read the article

  • iPhone: Calling dealloc on parentViewController causes an exception

    - by arielcamus
    Hi, I'm dealing with viewDidUnload and dealloc methods and I've founded a problem when calling [super dealloc]; in parent view controller. I have a lot of view controllers with custom code which I have putted outside on a parent view controller. So, when defining my view controllers I set a reference to the super class: @interface LoginViewController : AbstractViewController Then, at the dealloc method I call the AbstractViewController dealloc method: //(Login View Controller code) - (void)dealloc { [user release]; [passwd release]; [super dealloc]; } [super dealloc] execute the following code: //(Abstract View Controller code) - (void)dealloc { [dbUtils release]; [loadingView release]; [super dealloc]; } If I simulate a memory warning on iPhone Simulator, the following exception is thrown: 2010-03-03 11:27:45.805 MyApp[71563:40b] Received simulated memory warning. 2010-03-03 11:27:45.808 MyApp[71563:40b] *** -[LoginViewController isViewLoaded]: message sent to deallocated instance 0x13b51b0 kill quit However, if I comment the [super dealloc] line in AbstractViewController the exception is not thrown and my app still running. Thank you for your help once again!

    Read the article

  • xcode project-/target-settings-syntax for linker flag force_load on iPhone

    - by Kaiserludi
    Hi all. I am confronted with the double bind, that on the one hand for one of the 3rd party static libraries, my iPhone application uses, the linker flag -all_load has to be set in the application project- or target settings, otherwise the app crashes at runtime not finding some symbols, called internally from the lib, on the other hand for another 3rd party static lib -all_load must not be set on application level, or the app won't build thanks to a "duplicate symbols"-linker error. To solve this issue I now want to use force_load instant of load_all, as it due to documentation it does the same like all_load, but only for the passed path or lib-file, instead of all libs. The problem with force_load is, I do not have a clue, how to pass a path or file as parameter with it, when passing it via xcode project- or target-settings. All syntax-possibilities coming to my mind either lead into xcode thinking its another linker flag instead of a parameter to the previous one, or the linker is throwing syntax related errors or the flag simply does nothing at all in comparison to not being set. I also opened the .pbxproj-file in a text-editor to edit it to the correct command line syntax manually, but when reloading the project with xcode, it auto changes the syntax into interpreting the parameter to force_load as a separate flag. Anyone having an idea on this issue? Thx, Kaiserludi.

    Read the article

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