Skip to content

Instantly share code, notes, and snippets.

View patelrohan's full-sized avatar
🤓

Rohan Patel patelrohan

🤓
  • Dynamic Island
View GitHub Profile
@patelrohan
patelrohan / SplashScreen.m
Created April 18, 2012 16:42
SplashScreen
-(void)fadeScreen2
{
CGRect appFrame = [[UIScreen mainScreen] applicationFrame];
UIView *view = [[UIView alloc] initWithFrame:appFrame];
view.autoresizingMask = UIViewAutoresizingFlexibleHeight|UIViewAutoresizingFlexibleWidth;
self.view = view;
[view release];
act1 = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];
[act1 setCenter:CGPointMake(320.0/2,300.0)];
@patelrohan
patelrohan / dropbox.m
Created March 28, 2012 05:13
dropbox
- (DBRestClient *)restClient
{
if (!restClient)
{
restClient =
[[DBRestClient alloc] initWithSession:[DBSession sharedSession]];
restClient.delegate = self;
}
return restClient;
}
//---------------------------------------Maps Code--------------------------------------
#pragma mark- Maps
-(void)makeAnnotation
{
for (int k=0;k<[annotations count];k++)
{
@patelrohan
patelrohan / Scrollsetup.m
Created March 9, 2012 09:08
Scrollsetup
-(void)setUpMiniOnOrientation
{
//RECUPERATION DES PROJETS
if (projectArray != nil)
{
projectArray = nil;
[projectArray release];
}
if (managedObjectContext == nil)
@patelrohan
patelrohan / Crashlog
Created March 6, 2012 12:57
Crashlog
Process: RDRProject [3619]
Path: /Users/c36/Library/Application Support/iPhone Simulator/4.3.2/Applications/82F1880B-5FAA-4F77-A944-3AFA6FCF990D/RDRProject.app/RDRProject
Identifier: RDRProject
Version: ??? (???)
Code Type: X86 (Native)
Parent Process: launchd [92]
Date/Time: 2012-03-06 18:16:44.823 +0530
OS Version: Mac OS X 10.6.7 (10J869)
Report Version: 6
@patelrohan
patelrohan / fetchrequest.m
Created March 2, 2012 12:52
Fetch Request Code
- (void)fetchRecords {
// Define our table/entity to use
NSEntityDescription *entity = [NSEntityDescription entityForName:@"Event" inManagedObjectContext:managedObjectContext];
// Setup the fetch request
NSFetchRequest *request = [[NSFetchRequest alloc] init];
[request setEntity:entity];
// Define how we will sort the records
@patelrohan
patelrohan / Coredata.m
Created March 2, 2012 10:11
Core data
- (void)viewDidLoad
{
[super viewDidLoad];
self.navigationItem.title=@"Home";
segmentToggle = segmentedControl.selectedSegmentIndex;
//-------------
if (managedObjectContext == nil)
{
@patelrohan
patelrohan / memory.m
Created February 27, 2012 06:51
Memory Leaks and Bad memory usage
//===================== Memory Leak===========================
NSString *str =[[NSString alloc]initwithFormate:@"Hello"];
UILabel *lbl=[[UILabel alloc]init];
lbl.text= str;
[str release];
UILabel *lbl2=[[UILabel alloc]init];
@patelrohan
patelrohan / Newspot
Created February 18, 2012 08:57
First screen after I capture image from camera.
- (void)viewDidLoad
{
[super viewDidLoad];
btn = 50;
scroll.contentSize = CGSizeMake(320, 570);
app.edit_flag=1;
[btn1 setBackgroundImage:[UIImage imageNamed:@"red_border_box.png"] forState:UIControlStateNormal];
UIBarButtonItem *cancel_btn=[[UIBarButtonItem alloc] initWithTitle:@"Cancel" style:UIBarButtonItemStylePlain target:self action:@selector(cancelBtnClicked:)];
self.navigationItem.rightBarButtonItem=cancel_btn;
@patelrohan
patelrohan / logoutFacebook
Created February 10, 2012 12:03
Logout from application using Facebook a/c
//logout mehthod========================*******************===============
- (void)logOutButtonPressed {
NSLog(@"logout");
fbGraph.accessToken = nil;
NSHTTPCookie *cookie;
NSHTTPCookieStorage *storage = [NSHTTPCookieStorage sharedHTTPCookieStorage];
for (cookie in [storage cookies])