Friday, March 13, 2009

Quick tip: how to resize image?

Load image data:

UIImage *image = [[UIImage alloc] imageNamed: @"image.jpg"];

Create respective view:

UIImageView *imageView = [[ UIImageView alloc ] initWithImage: image];

Make frame, where you want to show image:

imageView.frame = CGRectMake(0.0, 0.0, 200.0, 200.0);

Finally, draw image:

[self.view addSubview: imageView];


P.S. Parameters of CGRectMake:
CGRectMake( [x point], [y point], [width], [height] )

Friday, December 19, 2008

Решение проблемы с Апп Энджин

Если вы получили ошибку "you do not have permission to modify this app", нужно переименовать папку, где лежит приложение. Назвать нужно именем, которое вы зарегистрировали в Апп Энджине. Например, вы зарегистрировали приложение ebtvoyumat. Значит и папка должна называться точно так же.

Wednesday, May 14, 2008

Man - manual page viewer

Finally I have compiled man and groff for iPhone. Link for downloading - http://narod.ru/disk/323720000/Groff.rar

First result compiling on iPhone

First result of compiling application on iPhone by native gcc:
terminal browser Netrik:

http://narod.ru/disk/156066000/netrik

Тerminal ICQ-client climm:

http://narod.ru/disk/156067000/climm

GCC on iPhone

On iPhone we can launch native gcc compiler. Thanks to Saurik и iGuga.

1. Install Cydia: Go to Settings -> General -> Auto-Lock -> Never.
In the Installer add source http://apptapp.saurik.com/.
Go to Install -> System -> Cydia Packager.
Installing. Wait for 8-10 mins. Cydia will move application, pics, etc. to the bigger iPhone's partition just to free space for programs like gcc or python.

2. Go to Cydia. In the right upper corner tap on the source refresh and install GNU C compiler from the section Development.

3. From section Terminal Support install MobileTerminal.

4. Download officialiPhone SDK.

5. On the iPhone delete folder /usr/lib/gcc/arm-apple-darwin8/4.2.1/include.

6. From the official iPhone SDK copy folder include and paste onto iPhone in folder /usr/lib/gcc/arm-apple-darwin8/4.2.1/.

7. Write test c-file

#include <stdio.h>

int main()
{
printf("Hello world!\n");
return 0;
}


Name it test.c

8. Put it into iPhone(for example in folder /var/mobile).

9. Launch Terminal on the iPhone.

10. Go to directory: cd /var/mobile.

11. Compile: gcc -o test test.c

12. Launch test program: ./test

14;-). Stare at terminal:

Hello world!