Saturday, 14 September 2013

Categories trong Objective - C

Categories là một khái niệm mới khi lập trình với Objective - C,
Categories là gì và dùng như nào? xin mời xem tiếp dưới bài:


// Đặt vấn đề:  Khi ta muốn thêm một số phương thức vào một lớp có sẵn ta sẽ có 2 cách

-- Viết lại mã nguồn
-- Dùng Category mở rộng lớp mà không cần phải viết lại mã nguồn của lớp cũ, Category cho phép ta mở rộng lớp cũ trong một bộ thực thi khác.

// dùng categories như nào:

Example:

//  B1: Tạo Class MyClass như sau

MyClass.h

@interface MyClass
- (void) print;
@end


MyClass.m

#import "MyClass.h"
@implemention MyClass
- (void) print{
NSLog(@"Đây là Print");
}
@end


// B2: Muốn thêm một phương thức "println" ta sử dụng tính năng của Category

MyCategory.h

#import "MyClass.h"
@interface MyCategory( MyNewCategory )
- (void) println;
@end

MyCategory.m

#improt "MyCategory.h"
@implemention MyCategory()d
-(void) println{
NSLog( @" Đây là Println " );
}
@end


// B3: Sử dụng Class đã tạo

Main.m

#import "MyCategory.h"
#import "MyClass"

int main( int argc, char *argv ){

MyClass *myObject = [ [  Myclass alloc  ] init  ] ;
[ myObject print ];
[ myObject println ];

}


int main ( int argc, char *argv )  {

NSLog(@" HelloWord");
}
Read More

Friday, 13 September 2013

Objective - C là gì, làm quen với Objective - C

GIỚI THIỆU OBJECTIVE - C

Objective - C  là một ngôn ngữ lập trình hướng đối tượng dùng để lập trình ứng dụng cho nền tảng Mac os, và các máy smartphone như iPhone, iPad.

Là một phần bổ xung cho ngôn ngữ ANSI C dựa trên smalltalk ( ngôn ngữ lập trình hướng đối tượng ). Objective - C mạng lại cho C đầy đủ khả năng lập trình hướng đối tượng một cách đơn giản và dễ hiểu.

Một đoạn mã Objective - C đơn giản:

        int main ( int argc, char *argv )  {
                NSLog(@" HelloWord");
        }

Read More

Phím tắt trong XCode

TỔNG HỢP PHÍM TẮT TRONG XCODE

XCode đã được tạo ra thực sự tiện dụng với những phím tắt, bất kỳ ai lập trình cũng đều quan tâm tới những phím tắt trong Xcode để cải thiện quy trình làm việc một cách nhanh chóng.


Bạn có thể tại file pdf tại đây: https://docs.google.com/file/d/0B-kX0bpMoUDHOVhCX3BWTkEwUjg/edit




Read More

Thursday, 22 August 2013

Here, there and everywhere: Google Keep reminds you at the right time

Notes are a good way to keep track of all you have to do, but most of us need a little nudge now and then. Google Keep can remind you of important tasks and errands at just the right time and place. For example, Keep works with Google Now to remind you of your grocery list when you walk into your favorite grocery store, and nudges you on Thursday night to take out the trash.

To get started, select the “Remind me” button from the bottom of any note and choose the type of reminder you want to add. You can add time-based reminders for a specific date and time, or a more general time of day, like tomorrow morning. Adding a location reminder is incredibly easy too—as soon as you start typing Google Keep suggests places nearby.


 
Of course, sometimes plans change. If you get a reminder you’re not ready to deal with, simply snooze it to a time or place that’s better for you.



 

It’s now even easier to get to all of your notes using the new navigation drawer, which includes a way to view all of your upcoming reminders in one place. And for people who want more separation between their home and work lives, the drawer also lets you easily switch between your accounts. 


And finally, we've made it easier to add your existing photos to a Google Keep note on Android. When you tap the camera icon you can choose between taking a new photo or adding one you already have from Gallery.

The new update is gradually rolling out in Google Play, and available now on the web at http://drive.google.com/keep and in the Chrome App.
Read More

Wednesday, 21 August 2013

The Beautiful Design Summer 2013 Collection on Google Play

Attention to detail makes an app truly beautiful: transitions are fast and clear, layout and typography are crisp and meaningful, and design touches that delight you in surprising ways are sprinkled throughout. Today, we’re publishing a new Beautiful Design collection on Google Play, which highlights 11 beautiful apps with these kinds of masterfully crafted design details.
The collection, which we’ll refresh with new apps every so often, currently includes:
  • Pattrn (by Lucas Rocha), a beautifully focused app for discovering and sharing unique wallpapers on any size screen device.
  • Pocket (by Read It Later), an article keeper and reader app with a beautiful queue browsing interface and a remarkably comfortable and pleasing reading experience on phones and tablets.
  • Timer (by Opoloo), a timer app with an elegant and deeply satisfying timer-creation interface and simple, beautiful theme choices.
  • Eye in Sky WeatherNY TimesGrand St.PinterestPressExpediaFlipboard and TED… each with delightful design details.
If you’re an Android developer, make sure to play with some of these apps to get a sense for the types of design details that can separate good apps from great ones.
Lastly, remember that this new Beautiful Design collection is just one of a number of unique collections on Google Play that are front and center in the new Google Play Store app client.
Read More

Wednesday, 26 June 2013

How To Resolve Invalid Project Description Error in Eclipse Working on Android Project

Frequently when I import projects from GIT via EGIT in Eclipse I get the error “Invalid Project Description” This bugged the hell out of me.



There are two kinds of places where projects can be located: 
 1) In the “default” location. This means that the project directory is a direct child directory of the workspace directory (aka the platform instance location), and the project directory name matches the project name.

 2) Outside the default location, in a directory that is neither a parent or child of the platform instance location. In this case the directory name does not need to match the project name. To ensure a successful import you have to make sure the directory you are creating inside of your \workspace\ dir matches that of the name defined in the .project file. In my example: \workspace3\warmupdater is the same name that is defined in the .project file. This will yield a successful import without the error “Invalid Project Description” warmupdater com.android.ide.eclipse.adt.ResourceManagerBuilder ... ..
Read More