0Pricing
Objective-C iOS Development for Legacy & Enterprise Apps · Ders

Temel Söz Dizimi ve Veri Türleri

Temel söz dizimini, ilkel veri türlerini ve NSString ile NSArray gibi yaygın Objective-C nesnelerini öğrenin.

Temel Söz Dizimi ve Veri Türleri, CoddyKit'te ücretsiz bir Objective-C iOS Development for Legacy & Enterprise Apps dersidir. Bu, 4 dersinin 2. dersidir. Aşağıdan dersin tamamını ücretsiz okuyabilir, sonra tarayıcıda yerleşik kod editörü ve 7/24 yapay zeka koçu ile uygulamalı olarak pratik yapabilirsin. Bu, Objective-C iOS Development for Legacy & Enterprise Apps öğrenme yolunun bir parçasıdır ve ilerlemeniz web ve CoddyKit uygulaması arasında senkronize olur. Objective-C iOS Development for Legacy & Enterprise Apps kursu toplamda 4 dersten oluşur.

Bu dersin bazı bölümleri henüz çevrilmemiş olup İngilizce olarak gösterilmektedir.

Objective-C Basics

Time for the fundamentals: Objective-C's basic syntax and the data types you will work with every day.

Statements End with Semicolons

Like other C-based languages, every Objective-C statement ends with a semicolon. Forget one and Xcode will flag it fast.

Explain Your Code with Comments

Comments are notes the compiler ignores. Use // for a single line and /* */ for multi-line blocks.

Primitive Data Types

Primitive types hold simple values: int, float/double, char, and BOOL (which is YES or NO).

Primitives in Action

Here those primitive types come to life — declared, assigned, and printed with NSLog format specifiers.

#import <Foundation/Foundation.h>

int main(int argc, const char * argv[]) {
  @autoreleasepool {
    int age = 30;
    float price = 19.99f; // 'f' for float literal
    double pi = 3.14159;
    char initial = 'J';
    BOOL isLoggedIn = YES;

    NSLog(@"Age: %i", age);
    NSLog(@"Price: %.2f", price);
    NSLog(@"Pi: %f", pi);
    NSLog(@"Initial: %c", initial);
    NSLog(@"Logged In: %@", isLoggedIn ? @"YES" : @"NO");
  }
  return 0;
}

Working with Text: NSString

For words and sentences you use the NSString object, not char. NSString is immutable: its contents never change after creation.

NSString Example

Declaring an NSString uses the @ prefix before the literal — a piece of syntax unique to Objective-C.

#import <Foundation/Foundation.h>

int main(int argc, const char * argv[]) {
  @autoreleasepool {
    NSString *greeting = @"Hello, CoddyKit!";
    NSString *name = @"Alice";
    NSString *message = [NSString stringWithFormat:@"Welcome, %@!", name];

    NSLog(@"Greeting: %@", greeting);
    NSLog(@"Personal Message: %@", message);
  }
  return 0;
}

Collections: NSArray

NSArray stores an ordered list of objects, accessed by zero-based index. It is immutable; use NSMutableArray when you need to change it.

NSArray Example

Create an NSArray with the @[] literal. The older arrayWithObjects form needs a nil terminator.

#import <Foundation/Foundation.h>

int main(int argc, const char * argv[]) {
  @autoreleasepool {
    // Array literal syntax
    NSArray *fruits = @[@"Apple", @"Banana", @"Cherry"];

    NSLog(@"First fruit: %@", fruits[0]); // Access by index
    NSLog(@"All fruits: %@", fruits);

    // Another way to create (older, but good to know)
    NSArray *colors = [NSArray arrayWithObjects:@"Red", @"Green", @"Blue", nil];
    NSLog(@"Colors: %@", colors);
  }
  return 0;
}

Quick Check on Types

Consider the following Objective-C declarations. Which one correctly defines a boolean variable named isActive and sets it to true?

Recap: Syntax & Data Types

Recap: semicolons end statements, comments document, primitives like int and BOOL hold simple values, and NSString and NSArray handle text and lists.

Sıkça Sorulan Sorular

“Temel Söz Dizimi ve Veri Türleri” dersi ücretsiz mi?

Evet — “Temel Söz Dizimi ve Veri Türleri” dersin tüm metni burada web'de ücretsiz olarak okunabilir. Etkileşimli olarak pratik yapmak (yerleşik kod editörü ve 7/24 yapay zeka koçu) ve Objective-C iOS Development for Legacy & Enterprise Apps kursunun geri kalanını açmak için CoddyKit PRO'ya yükselt. Objective-C iOS Development for Legacy & Enterprise Apps kursu toplamda 4 dersten oluşur.

“Temel Söz Dizimi ve Veri Türleri” dersinde ne öğreneceğim?

Temel söz dizimini, ilkel veri türlerini ve NSString ile NSArray gibi yaygın Objective-C nesnelerini öğrenin. Objective-C iOS Development for Legacy & Enterprise Apps ile uygulamalı kodu tarayıcıda doğrudan çalıştırarak pratik yaparsın ve 7/24 yapay zeka koçu dersi çalışırken sorularını yanıtlar.

Objective-C iOS Development for Legacy & Enterprise Apps öğrenmeye başlamak için deneyim gerekli mi?

Önceden deneyim gerekmez. CoddyKit'te Objective-C iOS Development for Legacy & Enterprise Apps, başlangıçtan ileri seviyeye kadar yapılandırıldığı için buradan başlayabilir veya başından başlayıp kendi hızında ilerleme yapabilirsin. Bu, 4 dersinin 2. dersidir.

“Temel Söz Dizimi ve Veri Türleri” dersi ne kadar sürer?

Çoğu CoddyKit dersi yaklaşık 5–10 dakika sürer. Her biri kısa ve etkileşimli olduğu için sabit ilerleme yaparsın ve web ile uygulama arasında tam olarak bıraktığın yerden devam edebilirsin.

Bu Objective-C iOS Development for Legacy & Enterprise Apps dersinde kod yazıp çalıştırabilir miyim?

Evet. Her Objective-C iOS Development for Legacy & Enterprise Apps dersi yerleşik bir kod editörü içerir, bu sayede tarayıcıda gerçek kod yazıp çalıştırabilir ve anlık yapay zeka geri bildirimi alırsın — yerel kurulum gerekli değildir.

Bu kursun tüm dersleri

  1. Objective-C'ye Giriş
  2. Temel Söz Dizimi ve Veri Türleri
  3. Objective-C için Xcode Kurulumu
  4. NSString ve Foundation Türleriyle Çalışma
← Objective-C iOS Development for Legacy & Enterprise Apps Sayfasına Dön