iphone-sdk-3.0

Has anyone used Buzz Andersen's Simple iPhone Keychain code?

不想你离开。 提交于 2019-12-06 05:34:30
You can find it here. I'm trying to understand his sample code in order to write a simple program with that stores passwords into the keychain and retrieves them for login. Has anyone done this before? It would be most appreciated if I can see any examples you may have. There's really no code to demonstrate, he lists both calls there. Heres's an example, for what it is worth: NSError *error; [SFHFKeychainUtils storeUsername:@"fred" andPassword:@"mypassword123" forServiceName:@"myService" updateExisting:YES error:&error]; NSString *storedPassword = [SFHFKeychainUtils getPasswordForUsername:@

How to enable multiple touches in an iOS app?

谁都会走 提交于 2019-12-06 05:10:53
Here is the code: - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { if ([touches count] == 1) { // code } else { // code } } When I simulate the double tap with the Option key in simulator, the code always chooses the first part of my if statement, as if there were only 1 touch received. Why am I not receiving both touches? The multipleTouchEnabled property needs to be set to YES before the view can accept multitouch. 来源: https://stackoverflow.com/questions/2287102/how-to-enable-multiple-touches-in-an-ios-app

Add Custom Controls to MoviePlayer in iPhone 3.0 SDK

时光总嘲笑我的痴心妄想 提交于 2019-12-06 04:58:12
I'd like to add custom controls to the mediaPlayer control view much as this asker: Add Custom Controls to MoviePlayer However, the solution posted in the above question is depreciated in 3.0. Does anyone know of a way to do this with the new SDK? So far I have added an overlayView to the moviePlayer view and can display my own controls on touch, but I can't seem to pass the touch on to the moviePlayer view to get it to display the native controls. I've been using touchesBegan and touchesEnded to no avail. Any help is appreciated. look at this sample project http://developer.apple.com/iphone

guardmalloc what are those warnings and how do I get rid of them?

痞子三分冷 提交于 2019-12-06 04:43:40
GuardMalloc: Allocations will be placed on 16 byte boundaries. GuardMalloc: - Some buffer overruns may not be noticed. GuardMalloc: - Applications using vector instructions (e.g., SSE or Altivec) should work. GuardMalloc: GuardMalloc version 18 (gdb) all of the sudden those guardmalloc messages appears in the console window. What's the cause and how do I get rid of it? Mostly because the application behaves weird after those appear. I guess you have intentionally enabled GuardMalloc to find memory errors? If so, these appear simply because GuardMalloc is being used (as shown by http:/

Alert with 2 buttons

二次信任 提交于 2019-12-06 03:04:12
I'm going to have a link to a website in my app. The user will click on a button that says Website and an Alert will appear with 2 buttons. One of the buttons is just going to be a cancel button and the other button is going to open the website. Could you help me with this? Thanks! put this into your header file: @interface YourViewController : UIViewController <UIAlertViewDelegate> put this into the class with your alert: - (void)alertOKCancelAction { // open a alert with an OK and cancel button UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Open?" message:@"Open Website?" delegate

How to make a Global Array?

六月ゝ 毕业季﹏ 提交于 2019-12-06 02:40:44
问题 So, I read this post, and it's pretty much exactly what I was looking for. However... it doesn't work. I guess I'm not going to go with the singleton object, but rather making the array in either a Global.h file, or insert it into the _Prefix file. Both times I do that though, I get the error: Expected specifier-qualifier-list before 'static' and it doesn't work. So... I'm not sure how to get it to work, I can remove extern and it works, but I feel like I need that to make it a constant. The

How to reload UIViewController

假装没事ソ 提交于 2019-12-06 01:47:49
问题 I want to reload all the views contained in tabbar controller(UIViewController).After searching I found that I've to apply setNeedsDisplay Method but I am not able to get where should I apply it.Any other alternatives are also welcomed - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { ..... ..... self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease]; [self customToolbar]; [self.window addSubview

Objective-C: UITableView cells get written over each time when scrolling up and down

南楼画角 提交于 2019-12-06 00:03:38
I have a UITableView that gets populated via CoreData , and have just noticed something strange. I have about 20 rows or so in the UITable, and when I scroll down the table and back up again, the cell's label gets written over the top of existing text, and keeps on doing it each time i go down and up again. My code for the CellForRowAtIndexPath is: // Customize the appearance of table view cells. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { //Some constants --- const NSInteger TOP_LABEL_TAG = 1001; const NSInteger BOTTOM_LABEL_TAG =

Objective-C error: Property 'active' is a scalar type on class 'Routine'. Cannot generate a getter method for it

不羁的心 提交于 2019-12-05 22:57:11
问题 I'm getting the above error when the following runs in the iphone simulator (3.0 OS): @interface Routine : NSManagedObject { } @property (nonatomic) BOOL active; @implementation Routine @dynamic active @end As you can see, I'm subclassing NSManagedObject because I'm using Core Data. In my data model, "active" is an option attribute of type Boolean. What am I doing wrong here? Thanks! 回答1: Everything that comes out of CD is an object, not a scaler. So, changer your code to: @interface Routine

How to display iPhone free memory ? and how to free iPhone memory?

烂漫一生 提交于 2019-12-05 19:31:25
How to display iPhone free memory in a UILabel ? and I would like to ask, how to free up memory using iPhone SDK? FYI, I'm using iPhone SDK 3.1.2 with xcode 3.2.1 (Mac OS X Snow Leopard). There is no direct access to this information in the SDK, and apps are not allowed to mess around with the OS the way you're suggesting. You're in your own little box; Apple expects you to stay there. When you ask questions that include "the system," you are probably outside of your box. That said, there are some tricks you can use. You can allocate increasingly-large blocks of memory until you receive