How to use Tapku library for iPhone? - iphone

I just found the Tapku library and would love to use the calendar, but am clueless as to where to start since I am new to iPhone dev. How do I go about presenting the calendar in one of my views?

TKCalendarMonthView *calendar1=[[TKCalendarMonthView alloc] init];
calendar1.delegate = self;
calendar1.dataSource = self;
[calendar1 selectDate:[NSDate date]];
[self.view addSubview:calendar1];
Add this in the .m file where you want to display.

have you looked in the demo project included in the library? i believe it has an example that would be very useful to you, and also, here is the developer documentation gitHub docs that includes the calendar class structure.

Related

UIKit NIB not loading in bundle

NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle </Users/quantum/Library/Application Support/iPhone Simulator/6.1/Applications/19503C82-22E2-4787-A4F5-8D83EDD5D58B/foo.app> (loaded)' with name '_UIDocumentActivityViewController''
I'm creating a QLPreviewController, presenting it to show a PDF. I then tap the share button. It crashes.
I downloaded Apple's Document Interaction example project. I put my PDF fetching class into there, fetched a PDF, display it.. and it works. No crash on the share button. Both are for targets 6.1. I tried setting Apple's code to target iPad only like my project. Their code works, mine doesn't, and I'm baffled. From the error message it sounds like a bug in the SDK but I can't pinpoint it.
Have you seen this before?
QLPreviewController *previewController = [[QLPreviewController alloc] init];
[previewController setDataSource:self];
[previewController setDelegate:self];
[self presentViewController:previewController animated:YES completion:^{}];
#pragma mark QLPreviewControllerDataSource
- (NSInteger) numberOfPreviewItemsInPreviewController:(QLPreviewController *)controller {
return 1;
}
- (id <QLPreviewItem>)previewController:(QLPreviewController *)controller previewItemAtIndex:(NSInteger)index {
return [NSURL fileURLWithPath:self.pdfPath];
}
I tried removing the reference to the framework, deleting derived data, cleaning the project, readding the QuickLook framework. I did show in Finder in both Apple's project & mine & they have the same path.
And same thing occurs when I use a UIDocumentInteractionController.
That little overlay with the email/print etc options is not loading in my project.
Apple support provided me with the answer.
I had over ridden an init method in a category and this screwed up the class initialization.
Moral: don't override init in a category method.
just try for initwithnib
QLPreviewController *previewController = [[QLPreviewController alloc] initWithNib: (QLPreviewController) bundle : nil];
hopefully it works.
if you have used NavigationController then use:
QLPreviewController *previewController = [[QLPreviewController alloc] init];
[self.navigationController pushViewController:previewController animated:YES];
else
QLPreviewController *previewController = [[QLPreviewController alloc] init];
[self presentModalViewController:previewController animated:YES];
According to Apple's documentation QL generators should not have NIB files as resources.
Although a Quick Look generator does not (and should not) have nib files as resources, you can add other resources if necessary.

error in gdata-objectivec-client api + oauth2 ios framework

guys i am doing google docs integration in my iphone app,
i have used the gdata-objectivec-client from http://code.google.com/p/gdata-objectivec-client/
and configured my project with this steps http://hoishing.wordpress.com/2011/08/23/gdata-objective-c-client-setup-in-xcode-4/
when i create instance of GTMOAuth2ViewControllerTouch.h using following code
GTMOAuth2ViewControllerTouch *viewController;
viewController = [[[GTMOAuth2ViewControllerTouch alloc] initWithScope:scope
clientID:kMyClientID
clientSecret:kMyClientSecret
keychainItemName:kKeychainItemName
delegate:self
finishedSelector:#selector(viewController:finishedWithAuth:error:)] autorelease];
[[self navigationController] pushViewController:viewController animated:YES];
i got this error missing GTMOAuth2ViewTouch.nib
please help me , thanks in advance.
You need to move the GTMOAuth2ViewTouch.nib file in root project(main project out side the data project)
I was having the same problem, but it was Xcode's problem.
You need to download the GTMOAuth2ViewTouch.nib file from SVN url give as http://gtm-oauth2.googlecode.com/svn/trunk/Source/Touch/. Download the file from here and then add it in your project. It will work fine.

How to add Events in iPhone calendar application using our iphone application.

How to add Event in iPhone Calendar. I just want to add events in iPhone calendar using my application and wants to set pushnotification for perticuler event. Please help me out on this. Thank you.
To create an Event programmatically, you would use EventKit, more specifically the provided EKEventEditViewController. See the Apple documentation for an explanation and sample code.
In iOS 4.0+, you would also be able to access that controller without writing any EventKit code. To do that, use a UITextView configured with dataDetectorTypes = UIDataDetectorTypeCalendarEvent. The UITextView will automatically convert strings representing formatted dates, days of the week, etc. - to clickable URLs that handle the creation of events.
Please refer to the Apple iOS documentation for the rest of your question. If there is anything specific that doesn't work in your case, please post some code, show us what you have tried already, etc.
you can use this code
EKEventStore *es = [[EKEventStore alloc] init];
EKEventEditViewController *controller = [[EKEventEditViewController alloc] init];
controller.eventStore = es;
controller.editViewDelegate = self;
[self presentModalViewController:controller animated:YES];
[controller release];

Problem when adding Three20 PhotoViewer to my UINavigationViewController

I want a photo viewer in my iphone app and I liked the Three20 photo viewer. I found it somehow hard to integrate it in my own app where I have my typical UINavigationViewController. So far I succeeded in doing the following:
TTURLMap *map = [[[TTURLMap alloc] init] autorelease];
[map from:#"tt://appPhotos" toSharedViewController:[PhotoViewController class]];
[self.navigationController pushViewController:[map objectForURL:#"tt://appPhotos"] animated:YES];
The only problem is that wenn I click back to my original view, its navigation bar keeps the style of the photo viewer (transperant and shows the view under it).
How can I get back my original navigation bar?
My experience: I once used three20's PhotoViewer and every time I went back from the PhotoViewer to my other view. The system status bar remained black and transparent (while it should be with default style). I solved it by manually and programmatically changing the status bar style every time when the back action was triggered.
Yes, this is a bit of an issue for sure. A good solution, as #diwup says, is to implement a manual fix. I tend to subclass TTPhotoViewer when I need it. Not only does it help with this problem but it also makes it much easier to use I find.
If you decide to subclass, then you should use whatever variation of the following you require:
- (void)viewWillDisappear:(BOOL)animated {
[super viewWillDisappear:animated];
self.navigationController.navigationBar.barStyle = UIBarStyleBlack;
self.navigationController.navigationBar.tintColor = myTintColor;
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleDefault];
}
However, if you don't want to subclass, you can always put the code into the - [viewWillAppear:] method of any class that comes after the photo viewer.

iOS4 ABNewPersonViewController Loses Data Entered when attempting to add a Photo iPhone 4

I have implemented a basic add contact feature to an iOS 4 application. Following the documentation from Apple, I have created a navigation controller, and set its root view to the ABNewPersonViewController. I have implemented the delegate as well. The basic mechanics all work.
The problem I am having is when you add a photo to the new person that is very large (taking a photo or picking one from the library), the ABNewPersonViewController form returns empty when the camera controls are dismissed. No photo is in the add photo box either. If I pick a small image (say a screenshot from the iPhone), everything works. I can see from the debug output: Received memory warning. Level=1
Has anyone else run into this? Is there a way to set the photo quality to a lower setting for the ABNewPersonViewController? Any help appreciated.
ABNewPersonViewController *abNewPersonView = [[ABNewPersonViewController alloc] init];
abNewPersonView.newPersonViewDelegate = self;
UINavigationController *newNavigationController = [UINavigationController alloc];
[newNavigationController initWithRootViewController:abNewPersonView];
[self presentModalViewController:newNavigationController animated:YES];
[abNewPersonView release];
[newNavigationController release];
If ABNewPersonViewController does not handle memory warnings correctly, file a bug with apple.