Search Results

Search found 2691 results on 108 pages for 'ios'.

Page 24/108 | < Previous Page | 20 21 22 23 24 25 26 27 28 29 30 31  | Next Page >

  • iOS Development: Why isn't my try block catching the exception?

    - by BeachRunnerJoe
    Hi. I have an exception being thrown in my code, but when I wrap it in an try/catch block, it doesn't get caught. The NSLog statement is never called in the catch block. Here's the code... NSInteger quoteLength; [data getBytes:(void *)&quoteLength range:NSMakeRange(sizeof(messageType), sizeof(quoteLength))]; @try { //Debugger stack trace shows an NSException being thrown on this statement NSData *stringData = [data subdataWithRange:NSMakeRange(sizeof(messageType) + sizeof(quoteLength), [data length])]; NSString *quote = [[NSString alloc] initWithData:stringData encoding:NSUTF8StringEncoding]; NSLog(@"received quote: %@",quote); [quote release]; } @catch (NSException * e) { NSLog(@"Exception Raised: %@", [e reason]); } Why doesn't it get caught? Thanks so much!

    Read the article

  • iOS Development: Should the "playersToInvite" property contain an array of strings or an array of GKPlayer objects?

    - by BeachRunnerJoe
    Should the playersToInvite property of the GKMatchRequest object contain an array of NSString objects that hold the player id's or should it contain an array of GKPlayer objects? The documentation on this critical property is not clear at all and I've tried both ways, but my code isn't working, so I can't tell by experimentation. Here's the description for that property in the docs... A list of players to invite to the match. Why did they even bother writing that? Thanks for your help!

    Read the article

  • ios - how do I concatinate strings to create a url?

    - by GeekedOut
    I am trying to make a url by first collecting the parameters, and then in one statement creating the actual url. Here is what I am trying to do: NSString *urlString = @"http://www.some_login_url.com?email=%@&password=%@"; NSString *email = self.email.text; NSString *password = self.password.text; NSString *url_to_send = [NSString stringWithFormat:@"%@%@", urlString , email , password]; So what I wanted to do was replace the @ symbols with the values in the variables, but instead the second variable just got appended to the end of the string. How would I change the last line so I could put the right parameters in their correct spots? Thanks!!

    Read the article

  • breakpoints not working properly on device with iOS 4.2.1 on Xcode 4.2

    - by rraallvv
    That seems odd to me, but apparently, Xcode 4.2 doesn't recognice breackpoints properly on my iPod Touch 2G running iOS 4.2.1, while it does on my other Ipod Touch 4G running iOS 6.0 Both devices are enabled for development, and their debug symbols information are retrieved from both devices and copied into ~/Library/Developer/Xcode/iOS DeviceSupport/... The only thing that seems suspect to me is that 4.2.1 is missing on /Developer/Platforms/iPhoneOS.platform/DeviceSupport/... I have 4.2 and 4.3 but nothing in between any help is appreciated

    Read the article

  • iOS sdk question: how do I cast a UIView to a UIImage View (alternativly how do I get a UIImageView from a GestureRecognzer?)

    - by user439299
    Desired end result: user taps a UIImageView and the image changes to another image (a subsequent tap returns the image to the original state) Problem: I add a (unique) selector to a bunch of UIImageViews (in an array) and point the action at the same function - let's call this function imageTapped: for now. Here is my code so far: -(void)imageTapped:(UITapGestureRecognizer *)tapGesture { UIImageView *view = tapGesture.view; // rest of code... } This code actually works fine but gets a warning when I run it: "Incompatible objective c types initilizing 'struct UIView *', expected 'struct UIImageView *' Any way to get rid of this? Not sure how casting works in objective c... primitive types seem to work fine such as (int)someFloat works fine but (UIImageView)someUiView doesn't work. Like I said, code works alright when I run it but would like to get ride of the compiler warning. Any help would be awesome.... I am very new to objective c (or any non java language for that matter) so be gentle. Thanks in advance.

    Read the article

  • iOS Development: How can I encapsulate a string in an NSData object?

    - by BeachRunnerJoe
    Hello. I'm building a multiplayer game on the iPhone and I need to send string data to the other players in the game. To do that, I need to encapsulate my NSString* string data in an NSData object somehow. Here's an example of how my code is structured... typedef struct { PACKETTYPE packetType; ??? stringToSend; //<---not sure how to store this } StringPacket; StringPacket msg; msg.packetType = STRING_PACKET; msg.stringToSend = ... // <---not sure what to do here NSData *packet = [NSData dataWithBytes:&msg length:sizeof(StringPacket)]; So my question is, if StringPacket is a struct defined in my header, what type should the stringToSend property be so that I can easily call the dataWithBytes method of NSData to encapsulate the packet data in an NSData object? Thanks for your wisdom!

    Read the article

  • iOS Development: Can I store an array of integers in a Core Data object without creating a new table to represent the array?

    - by BeachRunnerJoe
    Hello. I'm using Core Data and I'm trying to figure out the simplest way to store an array of integers in one of my Core Data entities. Currently, my entities contain various arrays of objects that are more complex than a single number, so it makes sense to represent those arrays as tables in my DB and attach them using relationships. If I want to store a simple array of integers, do I need to create a new table with a single column and attach it using a one-to-many relationship? Or is there a more simple way? Thanks in advance for your wisdom!

    Read the article

  • How to add Image On 'more' Button of UITabBarController in iOS 6?

    - by iPatel
    I know That How to add UITabBarController and how it used, I already done it. My Problem is only that I am no able to add image on 'more' button of UITabBarController. I know There are may Question That Similar to my Question but no one can help me. After googling I found that we can't add images on 'More' button in UITabBarController Because more button is autometically displayed by UITabBarController when UITabBarItem more Then 5. I also find that how to change SELECTION COLOR AND TITLE OF 'more' Button But I can not find abut 'more' button Image. So may be i need to Custom UITabBarController so, I also searching for any Custom UITabBarController but also I can not find it. Please help me on this Issue.

    Read the article

  • iOS - How to pass information from the VIEW to the Controller?

    - by user1720503
    I am fairly new to programming in general, and have been following the CS193p videos on iTunesU. I am currently doing assignment 3, and am having trouble getting a bit of information from the View sent to the View Controller. I believe I have set up the whole delegation thing correctly, so the question really is to how to get my View Controller to see a bit of information (such as self.bounds.size.width), which is a property that only the View has. Would this involve using self.dataSource? And if so, through what means could I pass this bit of information? Thanks!!

    Read the article

  • Awareness Makes Sure You’re Not Tuned Out While Listening to Music

    - by Jason Fitzpatrick
    iOS: You want to listen to your music but you don’t want to be totally unaware of your surroundings. What do you do? Install Awareness, a simple app that will alert you if your device mic picks up loud noises. Whether you want to fall asleep listening to some relaxing music while still hearing bumbs in the night or you want to listen to music when you’re out and about without being completely started by events your earbuds are filtering out. To use the app just run it in tandem with your music, adjust the sensitivity to account for the ambient sound, and you’re in business. If any sounds exceed that level, they’ll be piped in through your headphones to alert you. Awareness is currently free in the App Store (down from a high of $6.99) so if you’d like to play around with it, now’s the time to grab a copy. Awareness [via Addictive Tips] How To Be Your Own Personal Clone Army (With a Little Photoshop) How To Properly Scan a Photograph (And Get An Even Better Image) The HTG Guide to Hiding Your Data in a TrueCrypt Hidden Volume

    Read the article

  • How should I manage persistent score in Game Center leaderboards?

    - by Omega
    Let's say that I'm developing an iOS RPG where the player gains 1 point per monster kill. The amount of monsters killed is persistent data: it is an endless adventure, and the score keeps on growing. It isn't a "session score" like Fruit Ninja, but rather a "reputation score". There are Game Center leaderboards for that score. Keep killing monsters, your score goes up, and the leaderboards are updated. My problem is that, technically, you can log out and log in using a different Game Center account, kill one monster, and the leaderboards will be updated for the new GC account. Supposing that this score is a big deal, this could be considered as cheating, because if you have a score of 2000, any of your friends who have never played the game can simply log into your iPhone, play the game, and the system will update the score for their accounts, essentially giving them 2000 points in the leaderboards for doing nothing. I have considered linking one GC account to a specific save game. It won't update your score unless you're using the linked GC account. But what if the player actually needs to change their GC account? Technically they would be forced to start a new game and link their account to that profile. How should I prevent this kind of cheat? Essentially, I don't want someone to distribute a high schore to multiple GC accounts, given the fact that the game updates the score constantly since it isn't a "session score". I do realize that it isn't quite a big deal. But I'm curious about how to avoid this.

    Read the article

  • Collision with CCSprite

    - by Coder404
    I'm making an iOS app based off the code from here In the .m file of the tutorial is this: -(void)update:(ccTime)dt { NSMutableArray *projectilesToDelete = [[NSMutableArray alloc] init]; for (CCSprite *projectile in _projectiles) { CGRect projectileRect = CGRectMake( projectile.position.x - (projectile.contentSize.width/2), projectile.position.y - (projectile.contentSize.height/2), projectile.contentSize.width, projectile.contentSize.height); NSMutableArray *targetsToDelete = [[NSMutableArray alloc] init]; for (CCSprite *target in _targets) { CGRect targetRect = CGRectMake( target.position.x - (target.contentSize.width/2), target.position.y - (target.contentSize.height/2), target.contentSize.width, target.contentSize.height); if (CGRectIntersectsRect(projectileRect, targetRect)) { [targetsToDelete addObject:target]; } } for (CCSprite *target in targetsToDelete) { [_targets removeObject:target]; [self removeChild:target cleanup:YES]; } if (targetsToDelete.count > 0) { [projectilesToDelete addObject:projectile]; } [targetsToDelete release]; } for (CCSprite *projectile in projectilesToDelete) { [_projectiles removeObject:projectile]; [self removeChild:projectile cleanup:YES]; } [projectilesToDelete release]; } I am trying to take away the projectiles and have the app know when the CCSprite "Player" and the targets collide. Could someone help me with this? Thanks

    Read the article

  • How should a developer reject impossible requirements?

    - by sugar
    Here's the problem I'm facing: Quote From Project Manager: Hey Sugar, I'm assigning you the task of developing a framework that could be used for many different iOS applications. Here are the requirements: It should be able to detect the thickness of the thumb or fingers being used to manipulate the UI. With this information, all elements of the UI should be arranged & sized automatically. For a larger thumb, elements should be arranged nearer the center of the screen. For a smaller thumb, elements should be arranged nearer the corners of the screen. For a larger thumb, all fonts should be smaller. (We're assuming an adult in this case.) For a smaller thumb, all fonts should be larger. (We're assuming a younger person in this case.) Summary: This framework is required for creating user-friendly user interfaces programmatically. The framework should be developed in such a way that we can use for as many projects as needed, so it must also be very developer-friendly. I am the developer given this task, so my questions are as follows: How can I explain that these requirements are a little ridiculous? How can I explain that it would be better to concentrate on developing actual projects? How can I explain that even if this were possible, I wouldn't recommended developing such a thing? How do I say NO to this project politely, gently, and respectfully? How can I explain that even for a developer with 3 years of experience, this might not be possible?

    Read the article

  • Which one is better offline method for large scale application

    - by Manish Pansiniya
    We've a big data management website used by several property. Some of our customers have downtime (they can't access net for an hour or two). We want our site to support offline data viewing and inventory management (typical data search and add/remove) and when the user goes online we can sync the changes back to our central database. Customers use several platforms like Windows, iOS, etc. We've been looking into several different options, here are the major choices - Develop offline web app supported in HTML5. Develop a 'fallback' mechanism and interact with data from the app cache as explained in here (http://www.htmlgoodies.com/html5/tutorials/introduction-to-offline-web- applications-using-) Develop a desktop based cross platform solution. I remember the old MONO which has been popular. Here's a post (What do you suggest for cross platform apps, including web cross-platform-apps-including-web) and another one (Technology choice for cross platform development (desktop and phone)? platform-development-desktop-and-phone?rq=1) I realize the the desktop solution might be hard to maintain and result in some compatibility issues and demand test environments. Can HTML5 handle moderate to high level complexity and data flow? Or would it be better to rely on a desktop based app for better scalability & performance?

    Read the article

  • Updating large icon in iTunes Connect

    - by Shaggy Frog
    Just wanted to see if I understand properly how/when one can change the "Large icon" for their iOS app in iTunes Connect. Questions are in bold below. To start, first the facts (as I gather) from version 6.6 of the iTC guide (March 2, 2011): The Large Icon is a "locked" piece of version information "You will only be permitted to edit Locked version information when your app is in an Editable state" The "Editable" states are: Prepare For Upload Waiting For Upload Waiting For Review Waiting For Export Compliance Upload Received Rejected Developer Rejected Invalid Binary Missing Screenshot Am I missing anything up until this point? If not, then am I correct to say that the only time I can change an app's Large Icon is when I update the application? Here's a more specific use case: My app is currently on sale, version 2.0 I have version 2.1 ready, and I want the update to coincide with a sale, so I also put a "SALE" banner on top of my large icon (what most devs are doing) I have to upload this "SALE" Large Icon when I upload the binary. If I wait until it's been reviewed, it's too late, and I'll have developer-reject the binary so I can fix it. Is this correct? Say I want the sale to last a week. So at the end of that week, I'll want to switch my Large Icon back to the pre-"SALE" version. Will I necessarily have to upload a new binary at that time? (Also posted on the Developer Forums, but it's getting no love there...)

    Read the article

  • What is the correct and most efficient approach of streaming vertex data?

    - by Martijn Courteaux
    Usually, I do this in my current OpenGL ES project (for iOS): Initialization: Create two VBO's and one IndexBuffer (since I will use the same indices), same size. Create two VAO's and configure them, both bound to the same Index Buffer. Each frame: Choose a VBO/VAO couple. (Different from the previous frame, so I'm alternating.) Bind that VBO Upload new data using glBufferSubData(GL_ARRAY_BUFFER, ...). Bind the VAO Render my stuff using glDrawElements(GL_***, ...); Unbind the VAO However, someone told me to avoid uploading data (step 3) and render immediately the new data (step 5). I should avoid this, because the glDrawElements call will stall until the buffer is effectively uploaded to VRAM. So he suggested to draw all my geometry I uploaded the previous frame and upload in the current frame what will be drawn in the next frame. Thus, everything is rendered with the delay of one frame. Is this true or am I using the good approach to work with streaming vertex data? (I do know that the pipeline will stall the other way around. Ie: when you draw and immediately try to change the buffer data. But I'm not doing that, since I implemented double buffering.)

    Read the article

  • Strange and erratic transformations when using OpenGL VBOs to render scene

    - by janoside
    I have an existing iOS game with fairly simple scenes (all textured quads) and I'm using Apple's "Texture2D" class. I'm trying to convert this class to use VBOs since the vertices of my objects basically never change so I may as well not re-create them for every object every frame. I have the scene rendering using VBOs but the sizes and orientations of all rendered objects are strange and erratic - though locations seem generally correct. I've been toying with this code for a few days now, and I've found something odd: if I re-create all of my VBOs each frame, everything looks correct, even though I'm almost certain my vertices are not changing. Other notes I'm basing my work on this tutorial, and therefore am also using "IBOs" I create my buffers before rendering begins My buffers include vertex and texture data I'm using OpenGL ES 1.1 Fearing some strange effect of the current matrix GL state at the time of buffer creation I've also tried wrapping my buffer-setup code in a "pushMatrix-loadIdentity-popMatrix" block which (as expected) had no effect I'm aware that various articles have been published demonstrating that VBOs may not help performance, but I want to understand this problem and at least have the option to use them. I realize this is a shot in the dark, but has anyone else experienced this type of strange behavior? What might I be doing to result in this behavior? It's rather difficult for me to isolate the problem since I'm working in an existing, moderately complex project, so suggestions about how to approach the problem are also quite welcome.

    Read the article

  • Is this technique for stat tracking without a database workable?

    - by baptzmoffire
    If I wanted to create a chess game, for iOS, that tracked both player moves (for retracing the progression of a game and for player stats), what would be the simplest route to take? To clarify, I want to track not only the moves a player has made in a particular game, but how often that player has made that move in past games. For example I want to be able to track: How many times a given player has opened by moving the king pawn up two squares (e4) as white, on move number one. What is the percentage of time the player responds to white's e4 opening move, with moving his own king pawn to e5? What percentage of time does he respond by moving his queenside bishop pawn to c5? And so on. If it's not clear, the stat tracking system should also be able to report how many times this player, as black, move his queen to h1, on move number 30. I'm using Parse.com for my back-end as a server (BaaS) service. If I were to create a class that writes strings that identify move number, player color, moved piece, algebraic notation of the square (e.g. "d8") to a file, locally in the file system saves the file to Parse, and deletes the temporary file from file system upon opening the same game in my tableview (a la a "With Friends" game), download this file from Parse, parse through it and retrieve all stats/history, assign all relevant values to variables Is this plan viable, or is there an easier way?

    Read the article

  • Ad Service That Lets You Choose Your Ad, and Then Some [on hold]

    - by user3634450
    I'm trying to build an app for both Android and/or iOS where part of the gameplay actually involves ads as a texture. I need to be able to choose which ads I would like to use. I need to be able to be able to identify the ads (which if I can choose which ads show up in the app shouldn't be that hard). I need to be able to swap in and out new ads on what could possibly be a daily basis (and don't want to have to update the app to do it). And as if that wasn't too needy a list, I need to be able to load 50 ads from the pool of ads I deem fit, all to each and every user of the app at least every couple of days. I don't care if the ads pay, I'm not looking for clicks, but I don't want to have to make 50 fake ads every couple of days, from an "artistic" level I don't want the content to feel phony or fake, and I don't really have a way to load content to each user via some internet source (if anyone could name one that would be great). I'm not sure what kind of ad provider would like or even approve of this, in fact just what I've described might be against Google Play's or iTunes' content developer policies, but if anyone could give me any advice to steer me in the right direction it would be greatly appreciated, thank you.

    Read the article

  • Are there any significant advantages to using a native language for mobile app development?

    - by Karl Daniel
    Forgive me if this question has already been answered but I couldn't quite find the answer I was looking for. What I wanted to know was, is there any significant advantage to using a native language when developing and deploying apps to a mobile environment? The reason I ask is for a long while now I've been using Objective-C, Apple's native language for iOS, to build my apps. However I've been wondering whether or not there is any real benefit to doing this, over using a non-native language like JavaScript and then deploying it through a service like 'Phone Gap'? I do stress 'significant' advantages as native languages are always more likely to have the upper hand when it comes to speed and access to the latest APIs. However in general I don't see using a non-native language or a service like 'Phone Gap' causing and major slow down to my apps or restricting my development. Additionally having the ability to deploy to multiple services is also very handy indeed. This is why I put the question, are there any significant advantages to using a native language for mobile app development?

    Read the article

  • Offset Forward vector of object based on Rotation

    - by Taylor
    I'm using the Bullet 3D physics engine in a iOS application running openGL ES 1.1 Currently I'm accepting info from the gyroscope to allow the user to "look around" a 3d world that follows a bouncing ball (note: it only takes in the yaw to look around 360 degrees). Im also accepting information from the accelerometer based on the tilt to push the ball. As of right now, to move forward, the user tilts the devise forward (using the accelerometer); to move to the right, the user tilts the devise to the right and so on. The forward vector is currently along it's local Z-axis. The problem is that I want to change the ball bounce based on where the user has changed the view. If I change the view, the ball bounces in the fixed direction. I want to change the forward facing direction so that when a user changes the view (say to the look at the right of the world, the user rotates the device), tilting the devise forward will result in a forward force in that direction. Basically, I want the forward vector to take the rotation into consideration. Sorry if I didn't explain the issue well enough, its kind of confusing to write down.

    Read the article

  • How to prevent one account from unlocking products on other devices using Apple StoreKit?

    - by reapz
    We are currently wrapping up a free-to-play game on iOS in which you can purchase non-consumable products. We have been discussing this case internally and are not quite sure what the best practices are as this is our first title. For example, if a user downloads our app, and makes some purchases. These can be restored should the app ever be deleted and reinstalled as long as the user uses the same Apple ID. What is to stop him from making a fake Apple account, purchasing items and then posting this account on the web allowing everyone to get the items for free? That is obviously a worst case situation. But a smaller case would be a user unlocking items for his friends. We do not want this to be an always online game but have considered doing a check on startup if there is internet available. If the currently logged in account doesn't own the products do we lock them again? Probably not because people may simply sign into the device with different Game Center logins at which point we don't want to constantly lock and unlock items. At some point we will be adding multiplayer at which point we can definately do a check with the currently logged in account. This is because A, they will be online when attempting multiplayer, and B, they will want to use their own account for multiplayer. Unfortunately we aren't quite ready for this yet. Has anyone tackled this issue. Are we overthinking here?

    Read the article

  • What is the best way to store meshes or 3d models in a class

    - by Robse
    I am wondering, how I should store my mesh into memory after loading it from whatever file. I have Questions floating in my head: Should a mesh could have sub meshes or does the 3d model just store a list of meshes all on the same level Is there one material assigned to one mesh 1:1? What do I have to consider, if I want to store skeletal animations? Btw it's a OpenGL|ES2 iOS game using GLKit. I came up with some basic struct types: (But I think they are way to simple and I need to add padding or change the vector3 to vector4.) typedef union _N3DShortVector2 { struct { short x, y; }; struct { short s, t; }; short v[2]; } N3DShortVector2; typedef union _N3DShortVector3 { struct { short x, y, z; }; struct { short r, g, b; }; struct { short s, t, p; }; short v[3]; } N3DShortVector3; typedef GLKVector3 N3DFloatVector3; typedef struct _N3DMeshRecordSV3 { N3DShortVector3 v1, v2, v3; } N3DMeshRecordSV3; typedef struct _N3DMeshRecordSV3FN3ST2 { N3DShortVector3 v1, v2, v3; N3DFloatVector3 n1, n2, n3; N3DShortVector2 t1, t2, t3; } N3DMeshRecordSV3FN3ST2;

    Read the article

  • Weird UIView transforms in Retina iPhone

    - by ggambett
    I'm having a problem I don't understand. I'm developing an OpenGL app for iOS. Because at some points I want to force the orientation of the view programatically, and Apple for whatever reason doesn't make it easy (or even possible), I'm doing it by hand. I return always NO in shouldAutoRotateToInterfaceOrientation, and when I want to change the orientation (to portrait, for example), I do something like this in the UIView: [self setTransform:CGAffineTransformMake(1, 0, 0, 1, 0, 0)]; [self setBounds:CGRectMake(0, 0, 768, 1024)]; This works fine. In order to support Retina devices, I started checking [UIScreen mainScreen].scale, and setting self.contentScaleFactor accordingly. I also modified the code above to account for the new dimensions, like this: [self setTransform:CGAffineTransformMake(1, 0, 0, 1, 0, 0)]; [self setBounds:CGRectMake(0, 0, 2*768, 2*1024)]; Same rotation, different size. The weird result with this is that I get a "screen" with the right size, but offsetted half a screen to the bottom and the left. To correct for this, I need to do the following: [self setTransform:CGAffineTransformMake(1, 0, 0, 1, 0, 0)]; [self setBounds:CGRectMake(-768, -1024, 2*768 - 768, 2*1024 - 1024)]; This works, but it's ugly, I also need to make similar corrections when I get touch coordinates, and worst of all, I don't understand what's going on or why the above "correction" works. Can anyone shed some light on this issue?

    Read the article

  • Need ideas on how to give my levels structure

    - by akuritsu
    I am making an iOS game for a project at school. It is going to be a tiny bit like Fruit Ninja, as in it will have different things on the screen, and when you hit them, they die, and you get points. The trouble is that unlike Fruit Ninja, my game will have different types of sprites, all doing different things (moving different places, doing different things, etc). The one thing that is bad about having all of these sprites that do different things is that it is hard for them to look neat on the screen all together. I was planning on having a couple of different gamemodes: Time Trial You have 120 seconds to kill as many sprites as possible. Survival You have three lives, every time you try to hit a sprite and miss, you lose a life. ???? Whatever I think of. I am a rookie to game design in general, and I don't know the best way to make my game look good, and play well. I could have all of these sprites on the screen at the same time, or I could have them come in waves, for example 10 of sprite_a come on, and once they are killed, 10 of sprite_b come on, etc... Please give me your opinion about which one I should code. If you have any other suggestions for either a third gamemode, or a completely different way to make the levels, feel free to tell me.

    Read the article

< Previous Page | 20 21 22 23 24 25 26 27 28 29 30 31  | Next Page >