constructor overloading / different Init

Coding Questions, IDE related or anything else

constructor overloading / different Init

Postby berndnoetscher » Thu May 03, 2012 8:51 am

There is no possibility to have different Event Init() with different arguments yet
Code: Select all
Event Init()
End Event

Event Init(arg1 As String)
End Event

Event Init(arg1 As Integer, arg2 As String)
End Event



but a workaround is

What you can do right now is to have additional functions you call.

in myClass.NSObject.objb

Code: Select all
Event Init()
End Event

Public Sub Initialize1(arg1)
End Sub

Public Sub Initialize2(arg1, arg2)
End Sub




code where your class is used
Code: Select all
Dim v  = myClass() : v.Initialize1(param1)

Dim v  = myClass() : v.Initialize2(param1, param2)

CU
Bernd
berndnoetscher
Site Admin
 
Posts: 280
Joined: Fri Feb 20, 2009 11:58 am

Return to Objective-Basic

Who is online

Users browsing this forum: No registered users and 0 guests

cron