How to hide Characters when Call Objective-C - ios

I have a URL for conference call from iPhone,
tel:1600123456,,,,,,1234#
This is the conference call number followed by the Passcode.
While calling the whole number and characters are displayed.
How can I hide the ',,' in the call.

That's managed by the system. I don't believe there's any way to override it.

Related

How to know AVSpeechSynthesizer speech finish in iOS objective c?

I have play pdf file text-to-speech. I have a converted pdf to string page by page. Add all page string in NSMutableArray(EX:- 150 pages pdf , add first index - first page string ). How to get the first page string is over and speaking finish ?. And speak second page string ? I have searched in Google but I didn't find anything. Any help is appreciated.
You don't have to think about page unit.
You have to think about utterance.
Any amount of text you send to the speakUtterance method,
and AVSpeechSynthesizer finishes speaking,
the following delegate method called.
speechSynthesizer:(AVSpeechSynthesizer *)synthesizer
didFinishSpeechUtterance:(AVSpeechUtterance *)utterance;
So inside the delegate method, you have to call speakUtterance method again.
But in usual case, a few words or sentences(normally one sentence) will be sent to AVSpeechSynthesizer. == call speakUtterance
Then if speaking finishes, inside the delegate method, logic begins to start next sentence or word.
It's all I can tell you.

CNContactStoreDidChangeNotification multiple times [duplicate]

I am able to observe the CNContactStoreDidChangeNotification when the contact database is changed while the app is in background state. I am pretty sure that only one observer was added to NSNotificationCenter.
The problem is NSNotificationCenter posts MULTIPLE times (2, 3, 5, and even more times) even if I only add one new contact.
Where is the problem?
Make certain you aren't adding the observer multiple times. This can happen without you realizing it if (for example) you call -addObserver from -viewDidLoad or -viewDidAppear in your view controller (as these might get called more than once throughout the life of your application), or from any of the application state callbacks in your app delegate (-applicationDidBecomeActive, -applicationWillResignActive, -applicationDidEnterBackground, -applicationWillEnterForeground, etc).
Wrap the call to -addObserver in a conditional that ensures it can only be called once (set a flag), and put NSLog statements around it so you can see in the debug console if you are getting there more than once. Search your code for other calls to -addObserver that you might have forgotten about.
Call -removeObserver before adding it, just to be sure (making sure to pass the same name and object as when you added it). Calling -removeObserver on an observer that doesn't exist is okay. Note that this is more of a band-aid than a fix - your code should be smart enough to know whether or not you've already added it - but this might help you diagnose the problem).
I just wrote a quick minimal test program that adds an observer (once!) on CNContactStoreDidChangeNotification and I only get the notification once when I add or change a contact. Write a similar test program for yourself and see if you get the same result. If your test program works correctly, then it is likely that your app is doing something you don't expect (and calling -addObserver multiple times).
I had the same problem, the number of times it fired varied between 2 & 3. The solution that worked for me was to set a semaphore variable, set in the handler and reset the semaphore when finished. Wrap the address book processing in an if statement on the semaphore to ignore further calls.
addressBkSemphore is reset to false in buildFrendsAndContacts
- (void)addressBkChange:(NSNotification *)note
{
if (addressBkSemphore == false)
{
addressBkSemphore = TRUE;
[self buildFrendsAndContacts];
}
}
Hope it helps.
You can start a one time execution timer or a dispatch after few seconds and cancel it in case there's a new contacts update within those seconds, thus ensuring that only the timer or dispatch_after triggered by the last update will actually execute (taking into account that all update calls come one after the other within under a sec. difference, as far as I tested)
And btw, I could reproduce the issue only when making change to contacts on the same device with my app. If I change the contacts on another device linked to the same apple account, there was only one update.

iOS Private API Method for Placing a Call Without Displaying the MobilePhone App?

I know that I can place a call using CoreTelephony's CTCallDialWithID. I also know that I can hang up with CTCallDisconnect. I am wondering how I can possibly initiate a call and then hang it up without displaying the MobilePhone app. I suspect it can be done, but I'm really stretched thin on this one because I'm not seeing anything obvious in either CoreTelephony or the MobilePhone app's headers.
Creker makes me believe it's possible in this unanswered duplicate from last year, but I have not been able to find anything resembling help on the subject, so I am turning to you. I am currently targeting iOS 8.1, but code to accomplish it for any iOS SDK would be of tremendous help to me.
Thanks!
see CTCall
To initiate a call without using MobilePhone, you can use the CTCallDial function.
CFStringRef number = CFSTR("15555555555");
CTCallRef call = CTCallDial(number);
/* Hold call */
CTCallHold(call);
/* Resume call */
CTCallResume(call);
/* End call */
CTCallDisconnect(call);
Note : The phone number passed to CTCallDial must be normalized. For example, +1 (555) 555-5555 will become 15555555555 after normalization.

Who is whose delegate?

I am a new learner of iOS and I am reading "iOS Programming 4th Edition-Big Nerd Ranch",there is a question while I am reading the 7th chapter.
it says
A button’s life is relatively simple. For objects with more complex lives, like a text field, Apple uses the delegation pattern. You introduce the text field to one of your objects: “This is your delegate, when anything interesting happens in your life, send a message to him.” The text field keeps a pointer to its delegate. Many of the message it sends to its delegates are informative: “OK, I am done editing!”.
It makes me confused,because at first,it means that the text field can be introduced to one of my objects as a delegate of them,but finally it says " the text field keeps a pointer to its delegate ". Isn't the text field itself a delegate of others,is it? So I don't understand who is whose delegate ? Does it mean that the text field can be delegate of others,but it can also have delegate of itself? or else?
Thanks in advance!
Your object is the delegate. The text field will be sending the messages to it.
Understand what delegate means: It's your delegate -- acting on behalf of your program logic, and interacting with the UI object to tell it what you want done. In a sense ambassador would be a better title, since it's representing you in some "remote" location.
Just as there might be a US ambassador to Thailand, your program might have an ambassador to the UITextField object. When you create the UITextField you tell it what object is it's ambassador/delegate and then the UITextField talks to that object when it needs to know what you want to do.
Many of Apple's framework objects take a delegate. A delegate is a pointer to some anonymous object that you know very little about. All you know about it is that it understands a certain set of calls (a protocol). It's like a private lingo.
The idea is that the system object sends information to the delegate to either tell it about what has happened (the user selected the picker item at index 4) or ask it about how it should behave (The user wants to scroll to the left. Should I allow it?)
By using the delegate design pattern, you can build general-purpose objects that can be used in a wide variety of situations, by a wide variety of different objects.
When you read delegate, think "customer". A system object is a shopkeeper. Its delegate is a customer.
The shopkeeper doesn't need to know much about his customer. He takes an order for a product, calls out the customer's number when the order is ready, hands over the product, takes some money, and moves on. The customer doesn't even have to speak very much of the shopkeeper's language - only enough to place the order, understand when the order is ready, and how to pay for it.
The protocol is the language that the object (shopkeeper) uses to talk to it's delegate (customer). It's a limited, formally defined language. Any delegate (customer) who understands the required words in the object's (shopkeeper's) language (protocol) can get services from the object (shopkeeper).
BTW, you should accept the answer that helped you first and/or best, and up-vote all answers that you find useful. In this case I think you should accept #MirekE's answer. He was the first one to give you a clear answer.

Setting NSOutputStream to be synchronous

I know there are few questions similar to this one, but in all cases the answer is to make it asynchronous.
According to the apple documentation (even though it is not recommended) polling is an available option. However, I just couldn't implement it.
Should probably mention I am doing it in c# using Xamarin, but if you
can give me an answer on how to do this in Objective-C that would be
good too.
Here is my attempt
while(true)
{
if (outStream.HasSpaceAvailable())
{
int output = ((NSOutputStream)outStream).Write(data, (uint)data.Count());
}
}
The problem here is that outStream.HasSpaceAvailable() is false indefinitely.
Reason why I want to do it synchronously:
Currently (in a test app) I am doing it asynchronously and it works for sending one stream of data per call to the method. However in the real App I will need to send lots of small data packets one after the other. Therefore, I need to wait for the data to be sent before I can send another packet.
If I try putting many calls to the delegate the data keeps overwriting the previous call...
It would be great if you could let me know how to do it synchronously first (for the sake of having one answer out there on it). If you think there is a better way to do it in an async way let me know too.
Thanks
EDIT :
Here is how I set up the session
SESSION=new EASession (Accessory, Protocol);
NSStreamStatus outputStream= SESSION.OutputSream;
outputStream.Open();
This is done when a button is pressed and before the while loop above (obviously).

Resources