This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-(NSMenu *)getMenu | |
{ | |
NSMenu *menu = [[NSMenu alloc]initWithTitle:@"Smart Bar App Menu"]; | |
NSMenuItem *firstItem = [[NSMenuItem alloc]init]; | |
[firstItem setTitle:@"Close Web App"]; | |
[firstItem setTarget:self]; | |
[firstItem setAction:@selector(sendCloseDelegate:)]; | |
[firstItem setEnabled:YES]; | |
[menu addItem:firstItem]; | |
[firstItem release]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-(void)moveToLocation:(NSPoint)location withInitialMousePosition:(NSPoint)position | |
{ | |
isDragging = YES; | |
windowContentView = [[self window]contentView]; | |
if (isDragging) { | |
//down | |
if (previousMousePosition.y > location.y) { | |
float current = position.y - location.y; | |
swapForce = round(current/drop_height); | |
if (swapForce != 0 && swapForce != previousSwapForce) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)drawRect:(CGRect)rect | |
{ | |
UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(10, 13, 100, 20)]; | |
[label setFont:[UIFont fontWithName:@"Neutraface Condensed" size:18]]; | |
[label setTextColor:[UIColor colorWithRed:96.0/255.0 green:40.0/255.0 blue:33.0/255.0 alpha:1.0]]; | |
[label setText:@"YOUR RATING"]; | |
[label setBackgroundColor:[UIColor clearColor]]; | |
[self addSubview:label]; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// MSJSonParser.m | |
// MySeeen | |
// | |
// Created by Thomas Ricouard on 11/02/12. | |
// Copyright (c) 2012 __MyCompanyName__. All rights reserved. | |
// | |
#import "MSJSonParser.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-(id)initWithResultSeachMovieDic:(NSDictionary *)dic | |
{ | |
self = [super init]; | |
if (self) { | |
_title = [dic objectForKey:@"name"]; | |
if ([self isNotNull:[dic objectForKey:@"alternative_name"]]) { | |
_alternateTitle = [dic objectForKey:@"alternative_name"]; | |
} | |
else{ | |
_alternateTitle = NSLocalizedString(@"No alternative title", @"No alternatie title movie object"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-(id)initWithMovieDic:(NSDictionary *)dic fromSearchResult:(BOOL)search | |
{ | |
self = [super init]; | |
if (self) { | |
_udid = [dic objectForKey:@"id"]; | |
_title = [dic objectForKey:@"name"]; | |
if ([self isNotNull:[dic objectForKey:@"alternative_name"]]) { | |
_alternateTitle = [dic objectForKey:@"alternative_name"]; | |
} | |
else{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <Foundation/Foundation.h> | |
#import "MSJSonError.h" | |
@protocol MSRESTRequestDelegate; | |
@interface MSRESTRequest : NSObject | |
{ | |
id<MSRESTRequestDelegate>__unsafe_unretained delegetae; | |
} | |
@property (nonatomic, unsafe_unretained) id<MSRESTRequestDelegate> delegate; | |
-(id)initWithMethod:(NSString *)method parameters:(NSArray *)array shouldEscapeParameters:(BOOL)escape; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@protocol MSRESTRequestDelegate; | |
@interface MSRESTRequest : NSObject <NSURLConnectionDelegate, RPLoginViewControllerDelegate> | |
{ | |
id<MSRESTRequestDelegate>__unsafe_unretained delegate; | |
BOOL _sucessResponse; | |
BOOL _isProcessing; | |
BOOL _autoLoginAttempt; | |
NSString *_method; | |
NSString *_ressource; | |
NSArray *_parameters; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-(void)executeBlockRequest:(void (^)(NSJSONSerialization *, MSJSonError *))handler | |
{ | |
[NSURLConnection sendAsynchronousRequest:[self constructRequest] queue:[NSOperationQueue currentQueue] completionHandler:^(NSURLResponse *res, NSData *data, NSError *error){ | |
NSJSONSerialization *json = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableLeaves error:nil]; | |
if (error) { | |
MSJSonError *errorRest = [[MSJSonError alloc]init]; | |
errorRest.name = error.description; | |
errorRest.name = error.description; | |
handler(json, errorRest); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package your.testpro; | |
import java.util.ArrayList; | |
import android.content.Context; | |
import android.view.LayoutInflater; | |
import android.view.View; | |
import android.view.ViewGroup; | |
import android.view.ViewGroup.LayoutParams; | |
import android.widget.BaseAdapter; |
OlderNewer