Тег ‘work’:

UIImage and Memory

+[UIImage imageNamed:]
• Reads the file, uncompresses it, caches result
• Cached copy of data is kept even if the UIImage is deallocated
• Low memory condition causes cache to be purged.
• No direct control over when cache is purged.
• Use for small frequently drawn images.
+[UIImage imageWithContentsOfFile:]
• Just reads enough of file to determine if it can open [...]

Теги: , , , , , , , ,

Комментарии отсутствуют

Simple XML Parser based on NSXMLParser +converter

Simple XML Parser based on NSXMLParser +converter to XML file
How To Setup:
insert next code to file “name of you project”_Prefix.pch
#import "XMLNode.h"
    #import "XMLParser.h"
    #import "XMLConvert.h"

Create and launching XMLParser.
You will get parsed data ( with XMLNode data type ) in callbackParser: method
NSURL *URLToFile = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"source" ofType:@"xml"]];
   
    XMLParser *parser [...]

Теги: , , , , , ,

Комментарии отсутствуют

Tutorial: Drag and Drop file on NSImageView

Step by step for starter developers…
1. Create a project in xCode with name “DragAndDrop” or any else…2. Add an element “NSImageView” on main view in the MainMenu.xib

Теги: , , , , , , ,

Комментарии отсутствуют

Universal web services suite for iPhone/iPad and Android apps

Hi there! We are a group of iPhone / Android developers who have developed a suite of web services to assist us and other developers in building great apps.
After numerous projects we have become tired of having to set up the server scripts to do all the same things for different clients. Most of the [...]

Теги: , , , , , , , , , ,

Комментарии отсутствуют

Use Matrix of rotate +MozOrientation

Previous post is simple example of usage MozOrientation. But now i use Matrix of rotate and i have nice animation.
You can read many information about Matrix of rotate here. These methods are used in game development, make animations and many others.
var context = drawingCanvas.getContext(’2d’);
 
var xc = 75;
var yc = 75;
var xi = 0;
var yi = [...]

Теги: , , , , , , ,

Комментарии отсутствуют

Resize and Mask an Image

Make image with a mask!

Source:
- (UIImage*) maskImage:(UIImage *)image  {
   
    CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
   
    UIImage *maskImage = [UIImage imageNamed:@"mask.png"];
    CGImageRef maskImageRef = [maskImage CGImage];
   
    // create a bitmap graphics context the size of the image
    CGContextRef mainViewContentContext = CGBitmapContextCreate (NULL, maskImage.size.width, maskImage.size.height, 8, 0, [...]

Теги: , , , , , , , ,

Комментарии отсутствуют

touchBegan/touchEnd in custom UIWebView

The main disadvantage in the object UIWebView is lack of methods touchBegan and touchEnd. But this question has been settled by some manipulations with privates possibilities:) Thank you Satoshi Nakagawa :)
PSWebView.h – empty
#import <uikit /UIKit.h>
 
@interface PSWebView : UIWebView
@end
</uikit>

If you need add method touchBegan then make step by step
1. add after 6 line
- (void)webView:(UIWebView*)sender tappedBeganWithTouch:(UITouch*)touch event:(UIEvent*)event;

2. [...]

Теги: , , , , , ,

Комментариев (10)

UIScrollView and touchesBegan/touchesEnded

Не работает touchesBegan и touchesEnded в UIScrollView
Что делать?
Много людей пишет об этой проблеме. Для себя я нашел не совсем стандартное решение.
К примеру есть контроллер X в котором наш UIScrollView. в этом же контроллере создадим UIView, но не совсем стандартный, а подготовленный зараннее и передюющий все ивенты  в наш контроллер X и вставим его в [...]

Теги: , , ,

Комментарии отсутствуют

Связываем UITableView и UISearchBar

Опишу как связывал UITableView и UISearchBar. Вот пару примеров:

К примеру у нас есть indexArray (NSArray) c объектами NSString. Нужно засунуть этот массив в табличку и связать с поисковой панелью.
Прежде рекомендую отсортировать весь массив, т.к. он в UITableView будет отсортирован только по заглавным буквам.
NSInteger alphabeticSort(id string1, id string2, void *reverse)
{
    if [...]

Теги: , , ,

Комментариев (8)

Расширяю кругозор…

Вот целый месяц ничего не писал на блоге :)
Было 2 причины:
1. Кто читает мой блог и читал about, тот знает что я учусь в универе и живу в общаге. У нас была реорганизация сети и не было интернета 2 МЕСЯЦА!!! Вот в понедельник пойду подключаться :)
2. На работе перешли под маки и нужно осваиваться эту [...]

Теги: , , ,

Комментарий (1)